You must log in or register to comment.
The greatest fixes to all your pointer issues:
- Use a debugger, so you’ll know when it happens.
- A simple safety check goes very far, and is easy to implement.
if (refVal != null) { //Do the thing } else { //Optional in case if your reference value is uninitialized, can be useful for certain things too }
The greatest fix to all your pointer issues are to use references.