Be more cautious about parsing json.
This commit is contained in:
1 parent
256d7b3d6c
commit
0f82e2a84d
1 file changed
+9
-1
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user