Cannot read property 'shift' of null

Currently I’m solving Sarven Treasure. Sometimes the level stops working somewhere in the middle with the following error:

Uncaught TypeError: Cannot read property ‘shift’ of null
(anonymous function)

After reloading the level I got the following ambiguous message:

Console log says that “world ended in won at frame…”, while Infinite loop detector still thinks that the code is invalid.

So it is possible that these two problems are connected somehow.

@nick, I can send you the script, if it helps you to clarify the problem.

Hmm, haven’t seen that one before. Please send me the script in a private message and I’ll check it out!