Attempt to de-reference a null object Salesforce Exception

Attempt to de-reference a null object Salesforce Exception

Salesforce Exception “System.NullPointerException: Attempt to de-reference a null object” is thrown when the Apex Code is trying to use/utilise an object that has not been instantiated, or an object’s attribute that has not been initialised.

Sample Code:

Account objAccount;
System.debug( objAccount.Name );

Leave a Reply