From c344f2b9cfd903a29d38461a77ba661c64b0eb15 Mon Sep 17 00:00:00 2001 From: Pranav Date: Tue, 6 Aug 2024 21:27:12 -0700 Subject: [PATCH] fix: Handle the case where message has no attachments (#9902) Fix the broken message sending due to the errors in attachment update PR https://github.com/chatwoot/chatwoot/pull/9784 Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> --- .../dashboard/store/modules/conversations/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/javascript/dashboard/store/modules/conversations/index.js b/app/javascript/dashboard/store/modules/conversations/index.js index 94c125494..b3e39d397 100644 --- a/app/javascript/dashboard/store/modules/conversations/index.js +++ b/app/javascript/dashboard/store/modules/conversations/index.js @@ -146,7 +146,10 @@ export const mutations = { [types.ADD_CONVERSATION_ATTACHMENTS](_state, message) { // early return if the message has not been sent, or has no attachments - if (message.status !== MESSAGE_STATUS.SENT || !message.attachments.length) { + if ( + message.status !== MESSAGE_STATUS.SENT || + !message.attachments?.length + ) { return; }