diff --git a/src/views/Conversations/Components/MessagesList.jsx b/src/views/Conversations/Components/MessagesList.jsx index a0df233..fdfeea0 100644 --- a/src/views/Conversations/Components/MessagesList.jsx +++ b/src/views/Conversations/Components/MessagesList.jsx @@ -37,9 +37,9 @@ const MessagesList = ({ messages, handlePreview, reference, longListLoading, get let headerObj, footerObj, buttonsArr; if (!isEmpty(template)) { const componentsObj = groupBy(template.components, (item) => item.type); - headerObj = componentsObj.header[0]; - footerObj = componentsObj.footer[0]; - buttonsArr = componentsObj.buttons.reduce((r, c) => r.concat(c.buttons), []); + headerObj = componentsObj?.header?.[0]; + footerObj = componentsObj?.footer?.[0]; + buttonsArr = componentsObj?.buttons?.reduce((r, c) => r.concat(c.buttons), []); } const parts = str.split(/(https?:\/\/[^\s]+|\p{Emoji_Presentation})/gmu).filter((s) => s !== '');