From efbaa484d73ebf3aaeb4a603b20ac335995b2b27 Mon Sep 17 00:00:00 2001 From: balibabu Date: Wed, 5 Feb 2025 18:19:38 +0800 Subject: [PATCH] Fix: Chat Assistant page goes blank #4566 (#4727) ### What problem does this PR solve? Fix: Chat Assistant page goes blank #4566 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- web/src/pages/chat/markdown-content/index.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/src/pages/chat/markdown-content/index.tsx b/web/src/pages/chat/markdown-content/index.tsx index 02ec95a6b..cd0ce3586 100644 --- a/web/src/pages/chat/markdown-content/index.tsx +++ b/web/src/pages/chat/markdown-content/index.tsx @@ -54,7 +54,8 @@ const MarkdownContent = ({ }, [content, loading, t]); useEffect(() => { - setDocumentIds(reference?.doc_aggs?.map((x) => x.doc_id) ?? []); + const docAggs = reference?.doc_aggs; + setDocumentIds(Array.isArray(docAggs) ? docAggs.map((x) => x.doc_id) : []); }, [reference, setDocumentIds]); const handleDocumentButtonClick = useCallback(