From 44f4f1c46fa6316933009d9106cecf66c111fd56 Mon Sep 17 00:00:00 2001 From: chiguyong Date: Thu, 2 Jul 2026 21:48:41 +0800 Subject: [PATCH] fix: add null check for chatStore.conversations in StickyModeHeader Optional chaining prevents TypeError when test mocks don't provide conversations array. --- .../server/frontend/src/components/chat/StickyModeHeader.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/agentkit/server/frontend/src/components/chat/StickyModeHeader.vue b/src/agentkit/server/frontend/src/components/chat/StickyModeHeader.vue index 9d3983c..a0a4182 100644 --- a/src/agentkit/server/frontend/src/components/chat/StickyModeHeader.vue +++ b/src/agentkit/server/frontend/src/components/chat/StickyModeHeader.vue @@ -159,7 +159,7 @@ const allExperts = computed(() => { // 中保存的 YAML color。 const liveColorByName = new Map() const liveAvatarByName = new Map() - const conv = chatStore.conversations.find( + const conv = chatStore.conversations?.find( (c: { id: string; messages?: unknown[] }) => c.id === chatStore.currentConversationId, ) if (conv?.messages) {