This is unintuitive behavior, and I’ve tripped over it a lot in the past. I think that it would be nice to either get a mechanism to check if a sprite is deleted, or have silent failures when I attempt to access a deleted sprite.
Edit: Per the comments below, a better solution would be to change Snap! so that scripts stop before clones are deleted.
I’m against silent failures. They make it harder to debug, because you don’t know what failed. I wish
gave an error message, to make it easier to catch off-by-one errors.
I know, my view is controversial around here because of the Scratch goal of never giving error messages so as not to scare away the tiny tots.
This sounds to me more like an issue with order of operations. The sprites seem to be deleted before the scripts stop, but that should be the other way around. There’s no reason this script should error when you press the stop button because the script should stop at the same time as deleting sprites.