uliwitness / Stacksmith

An intuitive software erector kit targeted at people new to programming, but with enough potential to stay useful once they've learned, inspired by HyperCard.
http://stacksmith.org
129 stars 13 forks source link

Don't crash when deleting a card #52

Closed uliwitness closed 9 years ago

uliwitness commented 9 years ago

Apparently we don't add a card to a background's member cards list until we actually load the card. This means that if you open a stack and delete its first card, there's only that one card with it, and we delete the background. The next card then tries to load that background, and crashes trying to de-reference NULL.

Solution is probably to put the background's ID into the stack's card list in the XML and associate them right away. But need to update stackimport to do the same, and at least detect them if missing and load all cards to protect from exploits.