Skip to content

Commit

Permalink
Fix deserialization of variable with value of null
Browse files Browse the repository at this point in the history
  • Loading branch information
dlech committed Jul 2, 2020
1 parent da68c4f commit d24c046
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/serialization/sb3.js
Expand Up @@ -988,6 +988,10 @@ const parseScratchObject = function (object, runtime, extensions, zip, assets) {
);
if (isCloud) runtime.addCloudVariable();
newVariable.value = variable[1];
// null is used elsewhere to mean that variable does not exist so variable can't have value of null
if (newVariable.value === null) {
newVariable.value = '';
}
target.variables[newVariable.id] = newVariable;
}
}
Expand Down

0 comments on commit d24c046

Please sign in to comment.