From d2f65380a17a5270d7c0d9a08aad1ca27f2be38a Mon Sep 17 00:00:00 2001 From: Gabe Kangas Date: Sun, 13 Nov 2022 14:49:49 -0800 Subject: [PATCH] Fix issue when trying to collapse non-user message --- web/components/chat/ChatContainer/ChatContainer.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web/components/chat/ChatContainer/ChatContainer.tsx b/web/components/chat/ChatContainer/ChatContainer.tsx index 82b8dbe24..e11a17dde 100644 --- a/web/components/chat/ChatContainer/ChatContainer.tsx +++ b/web/components/chat/ChatContainer/ChatContainer.tsx @@ -32,6 +32,10 @@ function shouldCollapseMessages(messages: ChatMessage[], index: number): boolean } const message = messages[index]; + if (!message || !message.user) { + return false; + } + const { user: { id }, } = message;