if (node != null)
{
// do something
}
It is the job of the developer to use a null value as meaning "undefined" or unitialized. There is no true "undefined" equivalent
in C#.
If you declare a reference type:
private string mystring;
It will be initialized as "null" within the scope of a class.
If you have a method:
private void MyMethod(string Variable)
{
}
A caller may pass a null value in as "Variable".
If you do not wish to accept null values I might suggest that you then throw an exception, depending on the context of the method:
throw new ArgumentNullException("Variable");
-- Hope this helps.