Skip to content

Commit b9f2235

Browse files
author
Walter Bender
committed
fix bug causing infinite loop while searching for exandables
1 parent 111ff64 commit b9f2235

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

js/blocks.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1625,7 +1625,13 @@ function Blocks(canvas, stage, refreshCanvas, trashcan, updateStage, getStageSca
16251625
this._expandablesList.push(blk);
16261626
}
16271627

1628-
blk = last(this.blockList[blk].connections);
1628+
if (this.blockList[blk].connections.length > 1) {
1629+
blk = last(this.blockList[blk].connections);
1630+
} else {
1631+
// A value block only connects back to its parent, so
1632+
// end the search here.
1633+
blk = null;
1634+
}
16291635
}
16301636
};
16311637

0 commit comments

Comments
 (0)