You need to sign in to do that
Don't have an account?
SFHelpMePlease
NullPointer Exception in Test Class
Hello - could any one help me with this problem in my test class?
Test class is having an issue with this statement:
if (String.isNotBlank(AcctId)){
rec = [Select Id, Name from Acct__c where Id1__c =: decimal.valueOf(Id_in) and AcctId__c =: AcctId ];
}
Error is: System.NullPointerException: Argument cannot be null
SOQL will not be run if the AcctId is blank or null.
Would you know how I could fix?
Test class is having an issue with this statement:
if (String.isNotBlank(AcctId)){
rec = [Select Id, Name from Acct__c where Id1__c =: decimal.valueOf(Id_in) and AcctId__c =: AcctId ];
}
Error is: System.NullPointerException: Argument cannot be null
SOQL will not be run if the AcctId is blank or null.
Would you know how I could fix?
SFHelpMePlease
Thank you! I figured out the issue. decimal.valueOf(Id_in) is causing the issue. I need to check for null first an convert it to a decimal if the value is not null. The SOQL has been updated to use the decimal field in my where clause.