Whose Error Is It?

C# printed this

System.NullReferenceException: Object reference not set to an instance of an object.
What it meansYour code accessed a member on a reference that is null, so there was no object instance behind the variable at that moment.
The first thing to checkUse the stack trace line to find the null variable; common causes are uninitialized fields, failed lookups, and missing dependency injection.
The walrus saysThe most polite way to say null.

More from C#

All 75 errors

Whose Error Is It? · Status Menu · Back to the bar