From 86d5a6739612f94b9e14843565f4be1212aaf9f1 Mon Sep 17 00:00:00 2001 From: i804074 Date: Mon, 9 Dec 2019 11:07:56 -0800 Subject: [PATCH] Need to check if buttons is null before rendering the button html to avoid app from crashing JIRA: https://sapjira.wdf.sap.corp/browse/SAPMLCONV-6296 --- src/components/Message/Card.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/Message/Card.js b/src/components/Message/Card.js index 70a2e3ad..e6c36cbc 100644 --- a/src/components/Message/Card.js +++ b/src/components/Message/Card.js @@ -12,7 +12,8 @@ const Card = ({ content, sendMessage, onImageLoaded }) => { if (imageUrl && sanitizeUrl(imageUrl) === 'about:blank') { return null } - + // https://sapjira.wdf.sap.corp/browse/SAPMLCONV-6296 + // Need to check if buttons is null before rendering the button html. return (
{imageUrl && } @@ -22,7 +23,7 @@ const Card = ({ content, sendMessage, onImageLoaded }) => { {subtitle &&

{truncate(subtitle, 80)}

}
- {buttons.length ? ( + {buttons && buttons.length ? (
{buttons.slice(0, 3).map((b, i) => (