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

Issue of Argument cannot be null
Hi All,
We have scheduled job and it is getting failed from last few days with following error.
Cause:null LineNumber:5 Message:Argument cannot be null. StackRace:Class.GenerateHashDigest.generateSHA256HashCode: line 5, column 1
Class.TargetListCreation.execute
Below is the code line which causing an issue in both of these classes.
Generatehashdigest
{
public static String generateSHA256HashCode(String nricNumber){
Blob targetBlob=blob.valueOf(nricNumber);
Blob hashValue=Crypto.generateDigest('SHA-256',targetBlob);
String hasValueNricNumber=EncodingUtil.convertToHex(hashValue);
return hasValueNricNumber;
}
Targetlistcreation
string nrHasCusStr = GenerateHashDigest.generateSHA256HashCode(eachTL.NRIC__c);
Need help on above issue. Thanks in advance.
Thanks,
Anish
We have scheduled job and it is getting failed from last few days with following error.
Cause:null LineNumber:5 Message:Argument cannot be null. StackRace:Class.GenerateHashDigest.generateSHA256HashCode: line 5, column 1
Class.TargetListCreation.execute
Below is the code line which causing an issue in both of these classes.
Generatehashdigest
{
public static String generateSHA256HashCode(String nricNumber){
Blob targetBlob=blob.valueOf(nricNumber);
Blob hashValue=Crypto.generateDigest('SHA-256',targetBlob);
String hasValueNricNumber=EncodingUtil.convertToHex(hashValue);
return hasValueNricNumber;
}
Targetlistcreation
string nrHasCusStr = GenerateHashDigest.generateSHA256HashCode(eachTL.NRIC__c);
Need help on above issue. Thanks in advance.
Thanks,
Anish
Can you keep the null check where ever you are passing the arguments. The error is occuring mainly because some argument is passing as NULl.
If this solution helps, Please mark it as best answer
Thanks,