Script error - TypeError: cannot read property 'ended' of undefined

Suddenly, I don't either.
EDIT: It is was happening to dangduomg here: How to make a closure in Snap!?