Runtime error 'nil' with unusable stack trace

Has anyone encountered an error where they get a nil error like this?

Runtime error
?:0: attempt to index a nil value
stack traceback:
[C]: ?
?: in function ‘?’
?: in function <?:215>

I’m trying to hunt down this error, but I can’t seem to find the cause of it, and the stack trace doesn’t help at all. Anyone have any idea how to get better debugging info?
[import]uid: 27183 topic_id: 11905 reply_id: 311905[/import]

Looks like it has to do with timer.performWithDelay when I set the number of iterations to a non-zero value the error appears. When set to 0 it doesn’t appear. [import]uid: 27183 topic_id: 11905 reply_id: 43433[/import]

anyone have any luck with this?? It seems in my case to be related to dispatching events from timer handlers … really frustrating as the error is so unhelpful. [import]uid: 81475 topic_id: 11905 reply_id: 60240[/import]

Check out these threads: http://developer.anscamobile.com/forum/2011/08/01/really-weird-error
http://developer.anscamobile.com/forum/2011/08/01/possible-addeventlistener-bugs

Basically, I had to reimplement the event dispatching functions and the errors went away.

[import]uid: 27183 topic_id: 11905 reply_id: 60245[/import]

thanks very much don!!!

simply adding :

local loqsprite = require(‘loq_sprite’)
loq_listeners(myObj);

fixed all my problems dispatching from myObj

Great stuff!!!

[import]uid: 81475 topic_id: 11905 reply_id: 60457[/import]

coolio :slight_smile:

btw, loq_listeners is in ‘loq_util’

so this would be a minimal example:

require('loq\_util')  
loq\_listeners(myObj)  

Cheers [import]uid: 27183 topic_id: 11905 reply_id: 60461[/import]