Skip to content

Commit 75ca43d

Browse files
committed
fix: use loose inequality for thread.branch null check to handle undefined thread
When thread is undefined (from useSidebarThreadSummaryById), thread?.branch evaluates to undefined. With strict inequality (!== null), undefined !== null is true, causing useGitStatus to receive a non-null gitCwd for a non-existent thread. Switch to loose inequality (!= null) to correctly handle both null and undefined.
1 parent 60b9b6c commit 75ca43d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

apps/web/src/components/Sidebar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ function SidebarThreadRow(props: SidebarThreadRowProps) {
298298
selectThreadTerminalState(state.terminalStateByThreadId, props.threadId).runningTerminalIds,
299299
);
300300
const gitCwd = thread?.worktreePath ?? props.projectCwd;
301-
const gitStatus = useGitStatus(thread?.branch !== null ? gitCwd : null);
301+
const gitStatus = useGitStatus(thread?.branch != null ? gitCwd : null);
302302

303303
if (!thread) {
304304
return null;

0 commit comments

Comments
 (0)