From c8903efa5ea61768487c5e42faec178259424d27 Mon Sep 17 00:00:00 2001 From: Augustin Date: Tue, 21 Apr 2026 22:43:38 +0200 Subject: [PATCH] fix: guard against empty tabs array in closeTab MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 💾 Generated with Crush Assisted-by: GLM-5-Turbo via Crush --- web/src/components/Shell.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/components/Shell.jsx b/web/src/components/Shell.jsx index 3556cfd..795837c 100644 --- a/web/src/components/Shell.jsx +++ b/web/src/components/Shell.jsx @@ -264,7 +264,7 @@ export default function Shell({ api }) { setTabs(prev => { const next = prev.filter(t => t.id !== tabId) - if (activeTab === tabId) { + if (activeTab === tabId && next.length > 0) { setActiveTab(next[next.length - 1].id) } return next