hi i'm recieveing something called a null reference exception whenever i try to run my code. i am testing for a null value and if it is null i carry out some action, if false i recursively call the same function using the next EVENT array of my custom event class using a basic if, else statement. instead of testing for != null i have also tried testing for == null but get the same response. code is below, also the function is supposed to return an array of long's (returnid's) using recursion. will this work??? thanks.
public long[] getchildeventid s(Event[] ukracelist)
{
long[] returnids = null;
if (ukracelist[0].Events != null)
{
getchildeventid s(ukracelist[0].Events);
}
else
{
returnids[0] = ukracelist[0].EventId;
return returnids;
}
return returnids;
}
public long[] getchildeventid s(Event[] ukracelist)
{
long[] returnids = null;
if (ukracelist[0].Events != null)
{
getchildeventid s(ukracelist[0].Events);
}
else
{
returnids[0] = ukracelist[0].EventId;
return returnids;
}
return returnids;
}
Comment