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

Batch Apex shows errors in Apex Jobs but not in debug logs

Hi all,


I have some batch apex. I start a batch and going by the debug logs, it looks like everything is running smoothly - no errors occur in the logs, and their statuses are 'Success'.


However, monitoring the Apex Jobs page, the job shows up once started, however, a few batches in, the status detail updates to "First error: Attempt to de-reference a null object". And that's all - there's no log an no clue as to where this problem is actually occuring. Looking through the debug logs, there's nothing there that shows an exception


I'm not perfect, it's perfectly possible I have a line of code doing something silly at a certain point - but any ideas how I can find out where I'm going wrong?


Try to run and see your SOQL queries against the id and check the map, List if you have any. Might be possible they try to refer a null object.