function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Attempt to de-reference a null object occurs without the error line in apex class

Hi All,



           I'd  trigger & custom controller which creates a custom object record and sets the logic respectively. 


           Custom record will be automatically created when an Event is created with following condition


 Status - 'Not Started' and for a particular record type. When Event is updated with Status - 'Completed'. Some fields become editable in custom record.


Now the problem is, when user tries to save the custom record "Attempt to de-reference a null object" error occurs without apex class line number. With the additional message "Your development organization has been notified". As the error happens only for a particular user in a Production environment. I didnt get the mail about the error from the concerned person.


While the custom record is generated, it carries some referenced field information such as Account & contact & it is not editable. Since I've a insert operation in try block, deletion of such referenced records wont throw error in the UI.


Is there anyway to point the issue, please help me!!







Have you turned on debug logging for that user and got them to reproduce the error - that should give you the line number in the log file.