S
Steve Sargent
Hi:
I'm trying to debug the following code, and it keeps looping on the if
statement:
public static bool operator ==
(OnlineMemberNode first, OnlineMemberNode second)
{
if(first == null)
{
return false;
}
...
}
I've set my breakpoint to the if condition, and it keeps looping
there, eventually causing a stack overflow. I don't understand. In
my testing, the first is an object of type AdminMode (inherits from
OnlineMemberNode).
Is there another way to test for an undefined value. Originally,
because the second parameter is undefined, when I call the member
variables to do the testing, I get a null pointer exception.
I think the problem is that each time I test the first parameter for
null, I'm recursively calling itself to perform the same test.
However, I don't really know a way around this.
How do I get around this endless loop?
Thanks for any help in advance.
Steve
I'm trying to debug the following code, and it keeps looping on the if
statement:
public static bool operator ==
(OnlineMemberNode first, OnlineMemberNode second)
{
if(first == null)
{
return false;
}
...
}
I've set my breakpoint to the if condition, and it keeps looping
there, eventually causing a stack overflow. I don't understand. In
my testing, the first is an object of type AdminMode (inherits from
OnlineMemberNode).
Is there another way to test for an undefined value. Originally,
because the second parameter is undefined, when I call the member
variables to do the testing, I get a null pointer exception.
I think the problem is that each time I test the first parameter for
null, I'm recursively calling itself to perform the same test.
However, I don't really know a way around this.
How do I get around this endless loop?
Thanks for any help in advance.
Steve