mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-03-14 01:09:51 -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) {
|
Sequencer.prototype.startThread = function (thread) {
|
||||||
var currentBlockId = thread.peekStack();
|
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;
|
thread.status = Thread.STATUS_DONE;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue