You need to sign in to do that
Don't have an account?
Carly Probasco 14
System.NullPointerException: Attempt to de-reference a null object Class.
I am getting the above error from this piece of code.
public Set<String> RatingRelease {get;set;} //Returns the Rating Release date or the rating pending IF (Today < currentQRpCase.Rating_Externally_Visible_Date__c){ String RatingRelease = 'Rating Pending'; } else IF(Today > currentQRpCase.Rating_Externally_Visible_Date__c){ String RatingRelease = currentQRpCase.Rating_Externally_Visible_Date__c.format(); } else { String RatingRelease = ''; }
Please do the null check like below:
public Set<String> RatingRelease {get;set;}
//Returns the Rating Release date or the rating pending
if(currentQRpCase.Rating_Externally_Visible_Date__c != null)
{
IF (Today < currentQRpCase.Rating_Externally_Visible_Date__c){
String RatingRelease = 'Rating Pending';
} else IF(Today > currentQRpCase.Rating_Externally_Visible_Date__c){
String RatingRelease = currentQRpCase.Rating_Externally_Visible_Date__c.format();
} else {
String RatingRelease = '';
}
}
else {
String RatingRelease = '';
}
Thanks,
Maharajan.C