Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Not really, you just know that you try to use null as variable. As simple as that.
You should just read it as "Object reference which you are trying to use is not set to any known object and right now it is probably a null" -
@MaLiN2223 when you're using a "variable" from an array that's converted from an HTTP response from an internal API server you have no control of - no, not really.
-
@MaLiN2223 yes, but that information is useless, since you don't know why it's null. you'd expect at least a "error parsing http value to variable" exception or something, that would be nice.
-
@contrastful yes, but that just means they you don't have any null checking before you use it. If there is a chance of null, you need to handle it to make sure you don't try to access properties without checking
-
@iam13islucky you don't need to explain that to me, I'm not coding for a day, haha. this was mostly a joke, but to be fair, C# exceptions are usually pretty clueless, still.
-
@contrastful well, I strongly disagree! They are very very informative as long as people provide strings inside them ! But in case empty error message there are somehow miss leading sometime.
-
Voxera116408yThe problem with object reference is that they almost never contain info on which reference is not set.
And especially on multiline object initializers it can be hard to track down.
I really long for not nullables in C# where the exception will trigger on assign :D. It might come in v7 that id in the works right now.
Along with pattern matching an immutables I see several whole categories of errors just never happen. -
emily5088yAs a newbie grad dev i got this error and asked what it meant. I got the reply "exactly what it says". I agree, not helpful
Related Rants
"Object reference not set to a reference of an object" is the single least helpful exception ever.
Also, I still hate Visual Studio. Sorry.
undefined
sacrificing one's soul to satan
xamarin
c sharp
c#