1 Answers1

1

for simple solution just make sure by check these variable is not null before execution job, data, job.rigStates, data.rigStates

because sometime the variable may be empty or null

For example

int jobLength = 0, dataLength = 0;
if(job != null && job.rigStates != null){
   jobLength = job.rigStates.Length;
}

if(data!= null && data.rigStates != null){
   dataLength = data.rigStates.Length;
}

// you statement
int count = Math.min(jobLength, dataLength);