fix: add null check for chatStore.conversations in StickyModeHeader

Optional chaining prevents TypeError when test mocks don't provide conversations array.
This commit is contained in:
chiguyong 2026-07-02 21:48:41 +08:00
parent b98e7cb42f
commit 44f4f1c46f
1 changed files with 1 additions and 1 deletions

View File

@ -159,7 +159,7 @@ const allExperts = computed<IExpertDisplay[]>(() => {
// YAML color // YAML color
const liveColorByName = new Map<string, string>() const liveColorByName = new Map<string, string>()
const liveAvatarByName = new Map<string, string>() const liveAvatarByName = new Map<string, string>()
const conv = chatStore.conversations.find( const conv = chatStore.conversations?.find(
(c: { id: string; messages?: unknown[] }) => c.id === chatStore.currentConversationId, (c: { id: string; messages?: unknown[] }) => c.id === chatStore.currentConversationId,
) )
if (conv?.messages) { if (conv?.messages) {