mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-03-13 17:04:39 -04:00
Correctly deal with empty substacks.
The stack needs to be popped in this situation.
This commit is contained in:
parent
559a2a0fab
commit
7cc0c00da6
1 changed files with 3 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue