Activity › Forums › Salesforce® Discussions › When does the error "Attempt to de-reference a null object" occurs? Salesforce® Discussions When does the error "Attempt to de-reference a null object" occurs? Posted by Anurag algoworks on August 31, 2018 at 2:24 PM When does the error “Attempt to de-reference a null object” occurs? chanchal kumar replied 7 years, 8 months ago 2 Members · 1 Reply 1 Reply chanchal kumar Member August 31, 2018 at 2:42 PM Hello Anurag, This error is caused by a line of code that is trying to use an object that has not been instantiated, or an object’s attribute that has not been initialized. NOTE: If the field Site was left empty, it will generate the error message as well. Log In to reply. Public All Members My Connections Only Me PublicAll MembersMy ConnectionsOnly Me Public All Members My Connections Only Me