From 68e479d64a100b9d74bc9eafee8407d87d5d1741 Mon Sep 17 00:00:00 2001 From: Tran Trung Tien Date: Tue, 28 May 2024 09:34:16 +0700 Subject: [PATCH] fix: crash app when reading undefined var --- src/app/core/utils/common/address-converter.ts | 3 ++- .../evm-popup-share/evm-popup-share.component.ts | 5 +++-- .../nft-detail/popup-share/popup-share.component.ts | 5 +++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/app/core/utils/common/address-converter.ts b/src/app/core/utils/common/address-converter.ts index 9b9afec3e..2ebc0d080 100644 --- a/src/app/core/utils/common/address-converter.ts +++ b/src/app/core/utils/common/address-converter.ts @@ -102,7 +102,7 @@ export function transferAddress(prefix: string, address: string) { }; } - if (address.startsWith(EWalletType.EVM)) { + if (address?.startsWith(EWalletType.EVM)) { return { accountEvmAddress: address?.toLowerCase(), accountAddress: convertEvmAddressToBech32Address(prefix, address), @@ -122,3 +122,4 @@ export function getEvmChecksumAddress(address: string) { return address; } } + diff --git a/src/app/pages/evm-token/evm-nft-detail/evm-popup-share/evm-popup-share.component.ts b/src/app/pages/evm-token/evm-nft-detail/evm-popup-share/evm-popup-share.component.ts index 702820e8d..58e534998 100644 --- a/src/app/pages/evm-token/evm-nft-detail/evm-popup-share/evm-popup-share.component.ts +++ b/src/app/pages/evm-token/evm-nft-detail/evm-popup-share/evm-popup-share.component.ts @@ -32,8 +32,8 @@ export class EvmPopupShareComponent implements OnInit { ''; } - closeDialog(isConfirm = false) { - this.dialogRef.close(isConfirm); + closeDialog() { + this.dialogRef.close(true); } executeShareLink(mode) { @@ -73,3 +73,4 @@ export class EvmPopupShareComponent implements OnInit { document.getElementById(item).classList.remove('icon--multi-color'); } } + diff --git a/src/app/pages/token-cosmos/nft-detail/popup-share/popup-share.component.ts b/src/app/pages/token-cosmos/nft-detail/popup-share/popup-share.component.ts index bede93b59..2b8cee5f8 100644 --- a/src/app/pages/token-cosmos/nft-detail/popup-share/popup-share.component.ts +++ b/src/app/pages/token-cosmos/nft-detail/popup-share/popup-share.component.ts @@ -32,8 +32,8 @@ export class PopupShareComponent implements OnInit { ''; } - closeDialog(isConfirm = false) { - this.dialogRef.close(isConfirm); + closeDialog() { + this.dialogRef.close(true); } executeShareLink(mode) { @@ -73,3 +73,4 @@ export class PopupShareComponent implements OnInit { document.getElementById(item).classList.remove('icon--multi-color'); } } +