Nullref in Dump() when ToString() returns null
I have an object whose ToString() implementation returns null in some instances. I noticed that when Dump() attempts to dump this object, it throws a nullref.
I have modified my code to no longer return null from the ToString(), but it ought to be trivial to update LinqPad to avoid this issue in the future.
Sample:
void Main()
{
new Bar().Dump(1);
}
// Define other methods and classes here
public class Bar
{
public override string ToString()
{
return null;
}
}
6
votes
Gordon Burgett
shared this idea