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