From 570be6fcc1f3bda8fec3e278dbccff2636b2e2be Mon Sep 17 00:00:00 2001 From: Jean-Luc Makiola Date: Wed, 8 Apr 2026 22:48:29 +0200 Subject: [PATCH] fix: prevent crash on login when user has no active threads activeThreads[0].id in useEffect dependency array threw when the array was empty. Use optional chaining to safely handle the empty case. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/client/components/AddToThreadModal.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/components/AddToThreadModal.tsx b/src/client/components/AddToThreadModal.tsx index 956122a..67e696a 100644 --- a/src/client/components/AddToThreadModal.tsx +++ b/src/client/components/AddToThreadModal.tsx @@ -63,7 +63,7 @@ export function AddToThreadModal() { open, activeThreads.length, activeThreads.some, - activeThreads[0].id, + activeThreads[0]?.id, catalogSessionThreadId, ]);