function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sonia InversoSonia Inverso 

Invalid Data Error

HI, am receiving the following error message when making any changes to an opportunity:

Error: Invalid Data. 
Review all error messages below to correct your data.
Apex trigger OpportunityTriggers caused an unexpected exception, contact your administrator: OpportunityTriggers: execution of AfterUpdate caused by: System.NullPointerException: Attempt to de-reference a null object: Class.OpportunityTriggerHandler.closeOpportunitiesWithSameSpaceController: line 424, column 1.

Any suggestions on how to fix?

thanks in advance. 
Deepak Kumar ShyoranDeepak Kumar Shyoran
Put a small validation in your code at line 424. 
if(yourVariable != null )
before accessing some property of fields of that list or single instance.