sugarlabs / musicblocks

Music Blocks -- A musical microworld
https://musicblocks.sugarlabs.org/
GNU Affero General Public License v3.0
539 stars 726 forks source link

check for undefined turtle #3892

Closed walterbender closed 1 month ago

walterbender commented 1 month ago

When prepping projects for loading, there is a check to see if a turtle is null, but not a check to see if the turtle is undefined. The latter case is triggering an error, which may or may not be causing the toolbar to disappear when loading a project from the Planet. In any case, it should be caught.

This patch checks for undefined as well as null. I assign a turtle ID of the length of the turtleList rather than Infinity in these situations.