From 9e030661578d5f26030c01fa10dde1687f25e5f9 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Tue, 12 Jan 2021 22:22:58 -0330 Subject: [PATCH] Fix UI crash when domain metadata is missing (#10180) The "Confirm public encryption key" page will now no longer crash when the domain metadata is missing. --- .../confirm-encryption-public-key.component.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ui/app/pages/confirm-encryption-public-key/confirm-encryption-public-key.component.js b/ui/app/pages/confirm-encryption-public-key/confirm-encryption-public-key.component.js index 08a3cbf95..c3d1dfaa2 100644 --- a/ui/app/pages/confirm-encryption-public-key/confirm-encryption-public-key.component.js +++ b/ui/app/pages/confirm-encryption-public-key/confirm-encryption-public-key.component.js @@ -158,23 +158,24 @@ export default class ConfirmEncryptionPublicKey extends Component { const { domainMetadata, txData } = this.props const { t } = this.context - const origin = domainMetadata[txData.origin] - const notice = t('encryptionPublicKeyNotice', [origin.name]) + const originMetadata = domainMetadata[txData.origin] + const notice = t('encryptionPublicKeyNotice', [txData.origin]) + const name = originMetadata?.name || txData.origin return (
{this.renderAccountInfo()}
- {origin.icon ? ( + {originMetadata?.icon ? ( ) : ( - {origin.name.charAt(0).toUpperCase()} + {name.charAt(0).toUpperCase()} )}