Better deleted-sprite behavior

Currently, if you run a script like this and then stop, it will yield an error:

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.

Here’s a demo:

@codingisfun2831t Thoughts?

I’m against silent failures. They make it harder to debug, because you don’t know what failed. I wish
untitled script pic (3)
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.

I suppose that makes sense, but what about a block that reports whether or not a sprite is deleted?

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.

That’s actually a good point, come to think of it.

Or, probably better, stop the issue causing this problem; that clones are deleted before scripts are stopped.

I think that @ego-lay_atman-bay made a similar comment above.

Bumping this so that it doesn’t auto-close in a couple weeks. (By the way, what’s the bumping etiquette look like here?)

IIRC, bumping is discouraged, but the general guideline is to bump when it disappears of the visible front page.

I see, thanks!