From 30d4f6c2f539770f605aed327ed1207ba2d8f0da Mon Sep 17 00:00:00 2001 From: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Date: Tue, 16 Jul 2024 07:02:02 +0530 Subject: [PATCH] fix: TypeError cannot read properties of undefined (reading 'status') (#9774) # Pull Request Template ## Description **Issue** The error `Cannot read properties of undefined (reading 'status')` occurs because the `error.response.status` is accessed without checking if `error.response` is present. I can't able to reproduce this issue. **Solution** To resolve this issue, I added a check to ensure that this `error.response` is defined before accessing the `error.response.status` Fixes https://linear.app/chatwoot/issue/CW-3322/typeerror-cannot-read-properties-of-undefined-reading-status ## Type of change - [x] Bug fix (non-breaking change which fixes an issue) ## Checklist: - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my code - [ ] I have commented on my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged and published in downstream modules --- .../routes/dashboard/settings/agents/AddAgent.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/javascript/dashboard/routes/dashboard/settings/agents/AddAgent.vue b/app/javascript/dashboard/routes/dashboard/settings/agents/AddAgent.vue index e91439453..9895fe030 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/agents/AddAgent.vue +++ b/app/javascript/dashboard/routes/dashboard/settings/agents/AddAgent.vue @@ -1,13 +1,13 @@