| ... | @@ -298,13 +298,13 @@ export default function Sidebar() { | ... | @@ -298,13 +298,13 @@ export default function Sidebar() { |
| 298 | | 298 | |
| 299 | dispatch({ type: "DELETE_THREAD", threadId }); | 299 | dispatch({ type: "DELETE_THREAD", threadId }); |
| 300 | | 300 | |
| 301 | if (!shouldDeleteWorktree || !orphanedWorktreePath) { | 301 | if (!shouldDeleteWorktree || !orphanedWorktreePath || !threadProject) { |
| 302 | return; | 302 | return; |
| 303 | } | 303 | } |
| 304 | | 304 | |
| 305 | try { | 305 | try { |
| 306 | await api.git.removeWorktree({ | 306 | await api.git.removeWorktree({ |
| 307 | cwd: threadProject?.cwd ?? orphanedWorktreePath, | 307 | cwd: threadProject.cwd, |
| 308 | path: orphanedWorktreePath, | 308 | path: orphanedWorktreePath, |
| 309 | }); | 309 | }); |
| 310 | } catch { | 310 | } catch { |