Skip to content

Commit 7456ffb

Browse files
committed
chore: Improve safety of flyout change listener.
1 parent da997e7 commit 7456ffb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/navigation.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,10 +239,10 @@ export class Navigation {
239239
if (!e.workspaceId) {
240240
return;
241241
}
242-
const flyoutWorkspace = Blockly.Workspace.getById(
243-
e.workspaceId,
244-
) as Blockly.WorkspaceSvg;
245-
const mainWorkspace = flyoutWorkspace.targetWorkspace;
242+
const flyoutWorkspace = Blockly.Workspace.getById(e.workspaceId) as
243+
| Blockly.WorkspaceSvg
244+
| undefined;
245+
const mainWorkspace = flyoutWorkspace?.targetWorkspace;
246246
if (!mainWorkspace) {
247247
return;
248248
}

0 commit comments

Comments
 (0)