Report post

Are you sure you want to report the post shown below? This will send an email to the ATVO administrators. Please include a short reason for reporting.

Users reporting for no reason may be locked out.


Post

Posted by Nick Thissen
on
You can debug these kind of problems by adding logging to the script. To log something to the Event Log you can add this:
Console.WriteLine("Write this to the event log");


You can add this line in multiple places to see exactly which part it does not reach.


The error says that you are trying to access an object with no value (a "null" object). To avoid these errors you have to check if any object you try to access is not null.

In the script you posted there are at least two places where this can happen:
1. The 'value' itself can be null if there is no 'entity session result' available.
2. The result.CurrentLap object may be null in rare cases too I think.

To avoid the error simply add these checks where appropriate:
if (value == null)
{
// do something appropriate, in this case probably just return nothing
return null;
}


You can do the same for 'result.CurrentLap'.