mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-01-11 10:39:56 -05:00
Be more cautious about parsing json.
This commit is contained in:
parent
256d7b3d6c
commit
0f82e2a84d
1 changed files with 9 additions and 1 deletions
|
@ -316,7 +316,15 @@ class Sequencer {
|
|||
const definitionBlock = thread.target.blocks.getBlock(definition);
|
||||
const innerBlock = thread.target.blocks.getBlock(
|
||||
definitionBlock.inputs.custom_block.block);
|
||||
const doWarp = JSON.parse(innerBlock.mutation.warp);
|
||||
let doWarp = false;
|
||||
if (innerBlock && innerBlock.mutation) {
|
||||
const warp = innerBlock.mutation.warp;
|
||||
if (typeof warp === 'boolean') {
|
||||
doWarp = warp;
|
||||
} else if (typeof warp === 'string') {
|
||||
doWarp = JSON.parse(warp);
|
||||
}
|
||||
}
|
||||
if (doWarp) {
|
||||
thread.peekStackFrame().warpMode = true;
|
||||
} else if (isRecursive) {
|
||||
|
|
Loading…
Reference in a new issue