Guard worktree cleanup on missing project

Co-authored-by: codex <[email protected]>
This commit is contained in:
Julius Marmingeandcodex committed 2026-02-12 22:44:25 -08:00
1 parent bc312825cf
commit 44506ba2f5
1 file changed
+2 -2
+2 -2
View File
@@ -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 {