From 8a4fed1bf2dcd4195e04c204af17f19a3e0c3a56 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Thu, 12 Feb 2026 22:44:25 -0800 Subject: [PATCH] Guard worktree cleanup on missing project Co-authored-by: codex --- apps/web/src/components/Sidebar.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/web/src/components/Sidebar.tsx b/apps/web/src/components/Sidebar.tsx index 82b348936c45d136011a91d9a2cefa8e78045b71..349034fdcf6c39a4a8a1de9ea26f519ae33a0885 100644 --- a/apps/web/src/components/Sidebar.tsx +++ b/apps/web/src/components/Sidebar.tsx @@ -298,13 +298,13 @@ export default function Sidebar() { dispatch({ type: "DELETE_THREAD", threadId }); - if (!shouldDeleteWorktree || !orphanedWorktreePath) { + if (!shouldDeleteWorktree || !orphanedWorktreePath || !threadProject) { return; } try { await api.git.removeWorktree({ - cwd: threadProject?.cwd ?? orphanedWorktreePath, + cwd: threadProject.cwd, path: orphanedWorktreePath, }); } catch { -- 2.54.0