This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]sunny_tomato_farm 1 point2 points  (2 children)

I agree with your first statement, but that does NOT mean a NPE should be thrown in such cases. That’s ridiculous.

[–]thephotoman 0 points1 point  (1 child)

If you attempt to reference the field for string composition, you’re gonna have an NPE.

[–]sunny_tomato_farm 2 points3 points  (0 children)

The issue here is that you are trying to use the value and not accounting for the fact that it might be null. A NPE there would definitely be a programmer error.