+ Start a Discussion
snakerootsnakeroot 

What is this error?

Can anyone help me out with this error?  System.NullPointerException: Attempt to de-reference a null object

 

I think what happened was I deployed an app to my sandbox.  The app requires some custom settings.  So I put in a value for getKey.  When I went to deploy, I deleted the custom setting since it wasn't setup before I deployed to my sandbox.  Now I'm getting the above error.  I'm not sure where to even begin to troubleshoot this.  Anyone have any ideas? 

 

 

Best Answer chosen by Admin (Salesforce Developers) 
snakerootsnakeroot

I figured this out.  It was a line of test code I was using that couldn't reference the custom settings, so the value was null and throwing this error. 

All Answers

snakerootsnakeroot

I figured this out.  It was a line of test code I was using that couldn't reference the custom settings, so the value was null and throwing this error. 

This was selected as the best answer
tomcollinstomcollins

Does the error refer to a particular line of code?

 

Somewhere in your code, you're not checking the return value of a function or method, and you're assuming it was successful and gave you an actual object.  If you try to do something to that object, you'll get a NullPointerException.