mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-23 14:32:59 -05:00
scratch-parser expects json string...
This commit is contained in:
parent
59d1c2a0b3
commit
7c7b016643
1 changed files with 3 additions and 1 deletions
|
@ -245,7 +245,9 @@ class VirtualMachine extends EventEmitter {
|
|||
deserializer = sb3;
|
||||
validatedProject = possibleSb3;
|
||||
} else {
|
||||
validate(json, (err, project) => {
|
||||
// scratch-parser expects a json string or a buffer
|
||||
const possibleSb2 = typeof json === 'object' ? JSON.stringify(json) : json;
|
||||
validate(possibleSb2, (err, project) => {
|
||||
if (err) {
|
||||
const errorMessage =
|
||||
`The given project could not be validated, parsing failed with error: ${JSON.stringify(err)}`;
|
||||
|
|
Loading…
Reference in a new issue