diff --git a/ui/src/views/compute/CreateSSHKeyPair.vue b/ui/src/views/compute/CreateSSHKeyPair.vue index f244fe2abb2..06b41dce998 100644 --- a/ui/src/views/compute/CreateSSHKeyPair.vue +++ b/ui/src/views/compute/CreateSSHKeyPair.vue @@ -176,7 +176,7 @@ export default { } else { api('createSSHKeyPair', params).then(json => { this.$message.success(this.$t('message.success.create.keypair') + ' ' + values.name) - if (json.createsshkeypairresponse && json.createsshkeypairresponse.keypair && json.createsshkeypairresponse.keypair.privatekey) { + if (json.createsshkeypairresponse?.keypair?.privatekey) { this.isSubmitted = true const key = json.createsshkeypairresponse.keypair.privatekey this.hiddenElement = document.createElement('a') diff --git a/ui/src/views/compute/KubernetesServiceTab.vue b/ui/src/views/compute/KubernetesServiceTab.vue index 55254dd537f..768fdf11a66 100644 --- a/ui/src/views/compute/KubernetesServiceTab.vue +++ b/ui/src/views/compute/KubernetesServiceTab.vue @@ -299,7 +299,7 @@ export default { fetchComments () { this.clusterConfigLoading = true api('listAnnotations', { entityid: this.resource.id, entitytype: 'KUBERNETES_CLUSTER', annotationfilter: 'all' }).then(json => { - if (json.listannotationsresponse && json.listannotationsresponse.annotation) { + if (json.listannotationsresponse?.annotation) { this.annotations = json.listannotationsresponse.annotation } }).catch(error => { diff --git a/ui/src/views/compute/MigrateWizard.vue b/ui/src/views/compute/MigrateWizard.vue index 9899dc5befe..10c0f818e78 100644 --- a/ui/src/views/compute/MigrateWizard.vue +++ b/ui/src/views/compute/MigrateWizard.vue @@ -309,7 +309,7 @@ export default { this.$showNotification({ type: 'error', message: this.$t('message.request.failed'), - description: (error.response && error.response.headers && error.response.headers['x-description']) || error.message, + description: (error.response?.headers?.['x-description']) || error.message, duration: 0 }) }).finally(() => {