Identifying error deep within a loop

This issue follows on from http://forum.servoy.com/viewtopic.php?t=4515. Now that I’ve solved the problem of loading beyond 400 records, now I get the ever helpful

Cannot convert null to an object.

deep within a double loop of several thousand records.

Are there useful techniques for teasing out what record is triggering this error message?

Morley:
This issue follows on from http://forum.servoy.com/viewtopic.php?t=4515. Now that I’ve solved the problem of loading beyond 400 records, now I get the ever helpful

Cannot convert null to an object.

deep within a double loop of several thousand records.

Are there useful techniques for teasing out what record is triggering this error message?

I think that running your method with debugger active can help you to solve your problem: this error message usually doesn’t refer to a value (that can change from record to record) but to something missing. So you’ll probably need just a run or two inside your loop.