Skip to content

Commit 4a5d535

Browse files
committed
Fix error with empty workspace
1 parent df1b1cc commit 4a5d535

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/layout.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,10 @@ export class BlocklyLayout extends PanelLayout {
5454
}
5555

5656
set workspace(workspace: PartialJSONValue) {
57+
const data = workspace === null ? { variables: [] } : workspace;
5758
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
5859
// @ts-ignore
59-
Blockly.serialization.workspaces.load(workspace, this._workspace);
60+
Blockly.serialization.workspaces.load(data, this._workspace);
6061
}
6162

6263
/**

0 commit comments

Comments
 (0)