Always unset topLevel in deleteStack_

Blocks may have topLevel set even if they are not present in this.stacks
This commit is contained in:
Tim Mickel 2016-06-06 14:54:32 -04:00
parent 18e4228399
commit 214daa8087

View file

@ -365,11 +365,9 @@ Runtime.prototype._addStack = function (id) {
*/
Runtime.prototype._deleteStack = function (id) {
var i = this.stacks.indexOf(id);
if (i > -1) {
this.stacks.splice(i, 1);
// Update `topLevel` property on the top block.
this.blocks[id].topLevel = false;
}
if (i > -1) this.stacks.splice(i, 1);
// Update `topLevel` property on the top block.
if (this.blocks[id]) this.blocks[id].topLevel = false;
};
/**