diff --git a/src/blocks/scratch3_procedures.js b/src/blocks/scratch3_procedures.js index 5caea72ee..86aacd059 100644 --- a/src/blocks/scratch3_procedures.js +++ b/src/blocks/scratch3_procedures.js @@ -54,7 +54,9 @@ class Scratch3ProcedureBlocks { argumentReporterStringNumber (args, util) { const value = util.getParam(args.VALUE); if (value === null) { - return ''; + // When the parameter is not found in the most recent procedure + // call, the default is always 0. + return 0; } return value; } @@ -62,7 +64,9 @@ class Scratch3ProcedureBlocks { argumentReporterBoolean (args, util) { const value = util.getParam(args.VALUE); if (value === null) { - return false; + // When the parameter is not found in the most recent procedure + // call, the default is always 0. + return 0; } return value; } diff --git a/src/engine/thread.js b/src/engine/thread.js index 316642222..47777a97a 100644 --- a/src/engine/thread.js +++ b/src/engine/thread.js @@ -349,6 +349,7 @@ class Thread { if (frame.params.hasOwnProperty(paramName)) { return frame.params[paramName]; } + return null; } return null; }