Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.

Commit 7493550

Browse files
JWandrockeGitHub Enterprise
authored andcommitted
Merge pull request #22 from ML-Leonardo/fix/SAPMLCONV-6296-button-null
Need to check if buttons is null before rendering the button html to …
2 parents fe12d36 + e764e82 commit 7493550

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/components/Message/Card.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ const Card = ({ content, sendMessage, onImageLoaded }) => {
1212
if (imageUrl && sanitizeUrl(imageUrl) === 'about:blank') {
1313
return null
1414
}
15-
15+
// https://sapjira.wdf.sap.corp/browse/SAPMLCONV-6296
16+
// Need to check if buttons is null before rendering the button html.
1617
return (
1718
<div className={'RecastAppCard CaiAppCard'}>
1819
{imageUrl && <img src={imageUrl} onLoad={onImageLoaded} className='RecastAppCard--img CaiAppCard--img' />}
@@ -22,7 +23,7 @@ const Card = ({ content, sendMessage, onImageLoaded }) => {
2223
{subtitle && <p className='Card--text-subtitle'>{truncate(subtitle, 80)}</p>}
2324
</div>
2425

25-
{buttons.length ? (
26+
{buttons && buttons.length ? (
2627
<div className='RecastAppCard--button-container CaiAppCard--button-container'>
2728
{buttons.slice(0, 3).map((b, i) => (
2829
<Button key={i} button={b} sendMessage={sendMessage} />

0 commit comments

Comments
 (0)