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

DEBUG|Attempt to de-reference a null object
Hi all,
I am getting this error when i put system.debug
Error:- Attempt to de-reference a null object
In this line i am getting error
system.debug('ProertyVisit Length - '+ p.Visit_Restrictions__c.length());
Thanks
I am getting this error when i put system.debug
Error:- Attempt to de-reference a null object
In this line i am getting error
system.debug('ProertyVisit Length - '+ p.Visit_Restrictions__c.length());
Thanks
Referring field( p.Visit_Restrictions__c) seems to be null, so you are getting deference error. You can check null condition before getting length..
if(p.Visit_Restrictions__c != null)
{
system.debug('ProertyVisit Length - '+ p.Visit_Restrictions__c .length() );
}
In the above comments by ArunKumar that nothing is coming up with p.Visit_Restrictions__c so you should debug the issue for that
and use that null condition so that your code will not fail.
Try this,