Skip to content

Commit ae9498f

Browse files
authored
chore: Improve safety of flyout change listener. (#469)
* chore: Improve safety of flyout change listener. * chore: Use null instead of undefined.
1 parent cedde35 commit ae9498f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/navigation.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,8 @@ export class Navigation {
241241
}
242242
const flyoutWorkspace = Blockly.Workspace.getById(
243243
e.workspaceId,
244-
) as Blockly.WorkspaceSvg;
245-
const mainWorkspace = flyoutWorkspace.targetWorkspace;
244+
) as Blockly.WorkspaceSvg | null;
245+
const mainWorkspace = flyoutWorkspace?.targetWorkspace;
246246
if (!mainWorkspace) {
247247
return;
248248
}

0 commit comments

Comments
 (0)