diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2021-06-18 12:38:21 +0200 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2021-06-18 12:38:57 +0200 |
commit | 16efaad606dc6de6312c68a287a4ec74241b223f (patch) | |
tree | a1629cce45e8f12e910bd3b4e2cfea5571dbeed8 /src | |
parent | a2e162d9ecda9fa735c950ac6226582f75bbbd90 (diff) |
Fix chain condition of responses
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/components/ContactDetails.vue | 2 | ||||
-rw-r--r-- | src/components/ContactDetails/ContactDetailsAvatar.vue | 4 | ||||
-rw-r--r-- | src/components/MembersList/MembersListItem.vue | 2 | ||||
-rw-r--r-- | src/store/contacts.js | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/src/components/ContactDetails.vue b/src/components/ContactDetails.vue index 405d49a7..1ef81ccb 100644 --- a/src/components/ContactDetails.vue +++ b/src/components/ContactDetails.vue @@ -573,7 +573,7 @@ export default { } catch (error) { if (error.name === 'ParserError') { showError(t('contacts', 'Syntax error. Cannot open the contact.')) - } else if (error.status === 404) { + } else if (error?.status === 404) { showError(t('contacts', 'The contact doesn\'t exists anymore on the server.')) } else { showError(t('contacts', 'Unable to retrieve the contact from the server, please check your network connection.')) diff --git a/src/components/ContactDetails/ContactDetailsAvatar.vue b/src/components/ContactDetails/ContactDetailsAvatar.vue index e8708743..abc7d64e 100644 --- a/src/components/ContactDetails/ContactDetailsAvatar.vue +++ b/src/components/ContactDetails/ContactDetailsAvatar.vue @@ -427,7 +427,7 @@ export default { id: this.contact.addressbook.id, uid: this.contact.uid, })) - if (response.status !== 200) { + if (response?.status !== 200) { throw new URIError('Download of social profile avatar failed') } @@ -441,7 +441,7 @@ export default { // Notify user showSuccess(t('contacts', 'Avatar downloaded from social network')) } catch (error) { - if (error.response.status === 304) { + if (error?.response?.status === 304) { showInfo(t('contacts', 'Avatar already up to date')) } else { showError(t('contacts', 'Avatar download failed')) diff --git a/src/components/MembersList/MembersListItem.vue b/src/components/MembersList/MembersListItem.vue index 51961a0d..47795d00 100644 --- a/src/components/MembersList/MembersListItem.vue +++ b/src/components/MembersList/MembersListItem.vue @@ -240,7 +240,7 @@ export default { leave: this.isCurrentUser, }) } catch (error) { - if (error.response.status === 404) { + if (error?.response?.status === 404) { this.logger.debug('Member is not in circle') return } diff --git a/src/store/contacts.js b/src/store/contacts.js index 0e8eb690..fd79b5a1 100644 --- a/src/store/contacts.js +++ b/src/store/contacts.js @@ -370,7 +370,7 @@ const actions = { console.error(error) // wrong etag, we most likely have a conflict - if (error && error.status === 412) { + if (error && error?.status === 412) { // saving the new etag so that the user can manually // trigger a fetchCompleteData without any further errors context.commit('setContactAsConflict', { contact, etag: error.xhr.getResponseHeader('etag') }) |