Skip to content

Commit a975065

Browse files
Really fixed critical bug that occured when creating a new canvas
1 parent 0c2db22 commit a975065

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/core/canvas-patcher.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ export default class CanvasPatcher {
4545
},
4646
setViewData: (next: any) => function (json: string, ...args: any) {
4747
const result = next.call(this, json, ...args)
48-
this.canvas.metadata = JSON.parse(json)?.metadata ?? {}
48+
49+
try { this.canvas.metadata = JSON.parse(json).metadata }
50+
catch (_e) { this.canvas.metadata = {} }
4951

5052
that.triggerWorkspaceEvent(CanvasEvent.CanvasChanged, this.canvas)
5153

0 commit comments

Comments
 (0)