Skip to content

Commit 1eff93a

Browse files
argenisleonclaude
andcommitted
fix: use optional chaining for projects in startNewThread
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 3ec8a5d commit 1eff93a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/client/src/stores/ui-store.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ export const useUIStore = create<UIState>((set) => ({
155155

156156
startNewThread: (projectId: string, idleOnly?: boolean) => {
157157
// Block thread creation on shared projects that haven't been set up yet
158-
const project = useProjectStore.getState().projects.find((p) => p.id === projectId);
158+
const project = useProjectStore.getState().projects?.find((p) => p.id === projectId);
159159
if (project?.needsSetup) return;
160160

161161
invalidateSelectThread();

0 commit comments

Comments
 (0)