I see this in the ReSharper beta code from time to time.
We all cause this from time to time by coding things like
Foo foo = getFoo();
where foo is null.
Suggestion to JetBrains:
Put preconditions on any method that expects non-null arguments.
Put guard statements around any usage that might be null.
This is basic good programming practice.
Of course I make the same mistake too often; I'm no better. We do that under pressure. I'm just encouraging the excellent programmers at JetBrains to hold each other to this high standard so I don't get this error anymore ]]>.
See http://www.eiffel.com "Design by Contract"
http://research.microsoft.com/specsharp/ "Non-null types"
Do you other programmers find yourself overlooking this too?
I can't wait till languages have a non-null type like SpecSharp is researching, to make it easier to avoid such errors at compile time.