My C# method occasionally (once every few thousand calls) crashes because of a null reference to a stack variable.
string MyFunc(MyObject obj)
{
string s = "select * from " + obj.ToString() + " where a=10";
return s;
}
The null reference is to the string variable s. The object obj looks fine in the debugger, and what is most mysterious is that this happens only once in a blue moon. Anyone got ideas? Is this possibly a .NET 2.0 problem or is there some memory corruption?
thanks for any help.
Tom
string MyFunc(MyObject obj)
{
string s = "select * from " + obj.ToString() + " where a=10";
return s;
}
The null reference is to the string variable s. The object obj looks fine in the debugger, and what is most mysterious is that this happens only once in a blue moon. Anyone got ideas? Is this possibly a .NET 2.0 problem or is there some memory corruption?
thanks for any help.
Tom
Comment