You need to sign in to do that
Don't have an account?
Attempt to de-reference a null object
I don't understand why I'm getting this error... I have the following code:
System.debug('BillingStreet = \'' + account.BillingStreet + '\'\n');
System.debug('BillingState = \'' + account.BillingState + '\'\n');
if (account.BillingStreet == '' || account.BillingStreet == null) ApexPages.addMessage( new ApexPages.Message(ApexPages.Severity.ERROR, 'The account must have a billing address.') );
If I remove the OR condition in the if statement, debug outputs the following:
BillingStreet = 'null'
BillingState = 'CA'
If I leave that in, I get the error: "Attempt to de-reference a null object"; the error refers to the "account.BillingStreet" test for null...
If I only test for null -- instead of empty string -- then I get the following error:
Data Not Available
The data you were trying to access could not be found. It may be due to another user deleting the data or a system error. [...]
'account' is not null BillingState is getting outputted (sp?) just fine.
WTF?