N
Norvin Laudon
Hi,
Should be simple, but I can't seem to get a handle on it.
I've over-ridden the == operator in my class.
public static bool operator==(XrayImage lhs, XrayImage rhs)
{
return ( (lhs.name == rhs.name) && (lhs.imageTimeDateStamp ==
rhs.imageTimeDateStamp) );
}
but now I can't compare a class instance to null! I get an error thrown in
my == function: "Object reference not set to an instance of an object."
i.e.:
XrayImage x;
if (x == null)
Thanks,
Norvin
Should be simple, but I can't seem to get a handle on it.
I've over-ridden the == operator in my class.
public static bool operator==(XrayImage lhs, XrayImage rhs)
{
return ( (lhs.name == rhs.name) && (lhs.imageTimeDateStamp ==
rhs.imageTimeDateStamp) );
}
but now I can't compare a class instance to null! I get an error thrown in
my == function: "Object reference not set to an instance of an object."
i.e.:
XrayImage x;
if (x == null)
Thanks,
Norvin