You need to sign in to do that
Don't have an account?

NullPointerException on If condition
In the below code, in the second line, I get an error System.NullPointerException: Attempt to de-reference a null object
Please help.
for (Application_Review__c ar : Trigger.new) {
if (String.isNotBlank(arts.get(ar.Application_Review_Type__c).iPad_Configuration__c)) {
reviewIds.add(ar.Id);
}
}
Greetings to you!
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks and Regards,
Deepali Kulshrestha.
There might be a possibility that the key i.e. ar.Application_Review_Type__c not present in 'arts'.
Debug the value of key before the If statement and also check whether that key is present in the map or not.
Thanks
You need to add null check conditions when you fill data in map arts and also check that arts map contains Application_Review_Type__c or not.
Try this code:
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks,
Ajay Dubedi