Ask <sprite> for <my name> loops endlessly if <sprite> is not defined

  1. What browsers show this problem? Chrome Version 83.0.4103.106 (Official Build) (64-bit)
  2. Please share an example project (if possible).
  3. Describes the steps to reproduce this issue. Below
  4. What does Snap! currently do? Loops when SPRITE is not in corral
  5. What should Snap! do instead? Fail gracefully with result 0 or blank.

This is in Ver 0.6.0 beta.

Transferred from Help for Snap per @bh suggestion due to possible bug :

I am using for an existing Sprite B1:
image
image
and getting the correct answer.

Then I wanted to use the same logic to test if sprite of a particular name existed or not, by using B5 (non-existing):
image
image
Which returns no answer, assuming because there is no sprite with that name.

If I execute this second ASK block by clicking on it, it comes back immediately.
But if I put it into a SAY block or try to assign it to a variable or even try to check it's length, then the block goes into an endless loop, trying to resolve the name.
image

  • Why is that?
  • Should it not return immediately with an empty STRING as name, or some equivalent value?

Sigh. The stop button works, so does evaluating stop all.
We're going to play the game of who-finds-a-possible-type-error until we've succeeded to make Snap! all slow with type checks. What ever happened to "don't protect users from themselves"?

Hi @jens,
I have worked around this problem using image .
So I am OK if you don't want to tackle it due to design preferences.

I think I just fixed it in the repo. Let's check again when we update the hosted beta version...

That happens to any reporter that doesn't report/reports undefined.