@setoelkahfi / svara / commits / 3afd71c

fix: crash attempting to destroy nonexistent panel

mellbacon committed Aug 20, 2024 at 15:56 UTC 3afd71c9d7abab17e12c20e35bffca04f55e10b8
1 file changed +1 -1
src/lib/Statusbar.svelte
+1 -1
@@ -97,7 +97,7 @@
97 show = false;
98 showBottomPanel.set(false);
99 let current = activeTools.find(t => t.tool.name === get(editortool).name);
100 - current.element.$destroy();
100 + if (current) current.element.$destroy();
101 activeTools = activeTools.filter(t => t.tool.name !== get(editortool).name);
102 editortool.set({name: "", options: [], buttons: []});
103 lastTool.set({tool: null, element: null});