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

Attempty to de-reference a null object


I have a class with a static variable and i'm trying to access this variable from a trigger and a receive this error.
But this error happens in production environment only.

Someone tell me why?

Example class:

public class CustomClass{
    public static boolean run = false;


Example trigger:

trigger CustomObject on CustomObject__c(before insert, before update){
  if( ) return;

Thank you!
Navee RahulNavee Rahul

Hello carvalho,

the sobject or any variable you use to Insert or Update is empty. and thats why u receiving the error.

D Naveen Rahul.
Vishal Negandhi 16Vishal Negandhi 16
What type of variable is this? Can you share the line where this variable is defined so that we get a better idea of what's wrong here.