From 50d2dbd46257eb40b8741b6fe91850b6e896e1a3 Mon Sep 17 00:00:00 2001 From: Devin Ellis Date: Thu, 26 May 2022 23:53:29 -0700 Subject: [PATCH] chore: Fix the exception while destructuring data in chatwoot:error listener (#4702) --- app/javascript/widget/store/modules/contacts.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/javascript/widget/store/modules/contacts.js b/app/javascript/widget/store/modules/contacts.js index c8187a9f8..587b84ac6 100644 --- a/app/javascript/widget/store/modules/contacts.js +++ b/app/javascript/widget/store/modules/contacts.js @@ -61,9 +61,7 @@ export const actions = { dispatch('conversationAttributes/getAttributes', {}, { root: true }); } } catch (error) { - const { - response: { data }, - } = error; + const data = error && error.response && error.response.data ? error.response.data : error IFrameHelper.sendMessage({ event: 'error', errorType: SET_USER_ERROR,