From eb08667d909b011ea21771b9b198322af069e40b Mon Sep 17 00:00:00 2001 From: williamhliu <137068196+williamhliu@users.noreply.github.com> Date: Wed, 17 Jan 2024 13:56:01 +0800 Subject: [PATCH] (fix)(chat-sdk) fix error when showcase return null (#636) --- webapp/packages/chat-sdk/src/ShowCase/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/packages/chat-sdk/src/ShowCase/index.tsx b/webapp/packages/chat-sdk/src/ShowCase/index.tsx index 8839e0839..58aa573d9 100644 --- a/webapp/packages/chat-sdk/src/ShowCase/index.tsx +++ b/webapp/packages/chat-sdk/src/ShowCase/index.tsx @@ -31,7 +31,7 @@ const ShowCase: React.FC = ({ height, agentId, onSendMsg }) => { if (pageNoValue === 1) { setLoading(false); } - const showCaseMapRes: any = res.data.showCaseMap; + const showCaseMapRes: any = res.data.showCaseMap || []; const list = Object.keys(showCaseMapRes) .reduce((result: ShowCaseItemType[], key: string) => { result.push({ msgList: showCaseMapRes[key], caseId: key });