You need to sign in to do that
Don't have an account?
Scott M - SFDC Fan
How to troubleshoot null pointer exceptions
Hi,
This is a general question. I'm not an experienced SF developer and I am running a test and it says I am trying to dereference a null object. I've set a checkpoint on the line under the line that is causing the error and from what I can tell, the object in question isn't null.
What else can I do to troubleshoot this?
Scott
This is a general question. I'm not an experienced SF developer and I am running a test and it says I am trying to dereference a null object. I've set a checkpoint on the line under the line that is causing the error and from what I can tell, the object in question isn't null.
What else can I do to troubleshoot this?
Scott
1. Initiate the variable when declaringing it.
2. Check the variable if it is null or empty. Most of dereference a null object error comes with this case, we try to access collections which are empty
Hey Akhil. Thanks for the quick response.
Your suggestion is how to code to avoid null pointer exceptions. From all I can tell, I don't have an issue.
The the line of code that is saying I am attempting to de-reference a null object:
What else can I do to figure out what is breaking?
Scott
Did you check your test data which you are creating in the test class?