fix: guard against empty tabs array in closeTab
All checks were successful
Beta Release / beta (push) Successful in 37s

💾 Generated with Crush

Assisted-by: GLM-5-Turbo via Crush <crush@charm.land>
This commit is contained in:
Augustin
2026-04-21 22:43:38 +02:00
parent f3cb306053
commit c8903efa5e

View File

@@ -264,7 +264,7 @@ export default function Shell({ api }) {
setTabs(prev => { setTabs(prev => {
const next = prev.filter(t => t.id !== tabId) const next = prev.filter(t => t.id !== tabId)
if (activeTab === tabId) { if (activeTab === tabId && next.length > 0) {
setActiveTab(next[next.length - 1].id) setActiveTab(next[next.length - 1].id)
} }
return next return next