NullPointerException de-reference a null object in Apex code trigger

NullPointerException de-reference a null object in Apex code trigger


It 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.


Solution-

Make sure the Object and/or the Attribute to be used is not null.

Comments