Guard worktree cleanup on missing project
Co-authored-by: codex <[email protected]>
This commit is contained in:
1 parent
0068a93cfa
commit
8a4fed1bf2
1 file changed
+2
-2
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user