From 730c0b1eeab16e3ffeb60f6ac0da0ebaf4bc61de Mon Sep 17 00:00:00 2001 From: sawka Date: Tue, 27 Aug 2024 13:45:05 -0700 Subject: [PATCH] fix nullptr for non-focused node --- frontend/layout/lib/layoutModel.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frontend/layout/lib/layoutModel.ts b/frontend/layout/lib/layoutModel.ts index 447ab0e3a..6edb233a4 100644 --- a/frontend/layout/lib/layoutModel.ts +++ b/frontend/layout/lib/layoutModel.ts @@ -267,6 +267,9 @@ export class LayoutModel { this.focusedNode = atom((get) => { const treeState = get(this.treeStateAtom); + if (treeState.focusedNodeId == null) { + return null; + } return findNode(treeState.rootNode, treeState.focusedNodeId); }); this.focusedNodeIdStack = [];