From 7cc0c00da66dc1378b6069b99f04bd575f35064e Mon Sep 17 00:00:00 2001 From: Tim Mickel Date: Fri, 10 Jun 2016 08:47:54 -0400 Subject: [PATCH] Correctly deal with empty substacks. The stack needs to be popped in this situation. --- src/engine/sequencer.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/engine/sequencer.js b/src/engine/sequencer.js index cbccd09b..1593c190 100644 --- a/src/engine/sequencer.js +++ b/src/engine/sequencer.js @@ -81,7 +81,9 @@ Sequencer.prototype.stepThreads = function (threads) { */ Sequencer.prototype.startThread = function (thread) { var currentBlockId = thread.peekStack(); - if (!currentBlockId || !this.runtime.blocks.getBlock(currentBlockId)) { + if (!currentBlockId) { + // A "null block" - empty substack. Pop the stack. + thread.popStack(); thread.status = Thread.STATUS_DONE; return; }