From ecabf249cc2463cc165f47021e20472a937adf5d Mon Sep 17 00:00:00 2001 From: ost-ptk Date: Mon, 25 Nov 2024 13:33:26 +0200 Subject: [PATCH] Fix null checks for accessing csprName properties. --- src/apps/connect-to-app/pages/switch-account/content.tsx | 2 +- .../pages/switch-account/unconnected-accounts-list.tsx | 2 +- src/apps/popup/pages/connected-sites/index.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/apps/connect-to-app/pages/switch-account/content.tsx b/src/apps/connect-to-app/pages/switch-account/content.tsx index af4446c1..86f0172a 100644 --- a/src/apps/connect-to-app/pages/switch-account/content.tsx +++ b/src/apps/connect-to-app/pages/switch-account/content.tsx @@ -134,7 +134,7 @@ export function SwitchAccountContent({ requestId }: SwitchAccountContentProps) { rows={connectedAccountsListItems} renderRow={(account, index) => { const csprName = - accountsInfo && accountsInfo[account.accountHash].csprName; + accountsInfo && accountsInfo[account.accountHash]?.csprName; return ( diff --git a/src/apps/connect-to-app/pages/switch-account/unconnected-accounts-list.tsx b/src/apps/connect-to-app/pages/switch-account/unconnected-accounts-list.tsx index e602df54..6134ff08 100644 --- a/src/apps/connect-to-app/pages/switch-account/unconnected-accounts-list.tsx +++ b/src/apps/connect-to-app/pages/switch-account/unconnected-accounts-list.tsx @@ -69,7 +69,7 @@ export const UnconnectedAccountsList = ({ renderRow={(unconnectedAccount, index) => { const csprName = accountsInfo && - accountsInfo[unconnectedAccount.accountHash].csprName; + accountsInfo[unconnectedAccount.accountHash]?.csprName; return ( diff --git a/src/apps/popup/pages/connected-sites/index.tsx b/src/apps/popup/pages/connected-sites/index.tsx index b2560728..3ed2fbc5 100644 --- a/src/apps/popup/pages/connected-sites/index.tsx +++ b/src/apps/popup/pages/connected-sites/index.tsx @@ -97,7 +97,7 @@ export function ConnectedSitesPage() { const accountHash = getAccountHashFromPublicKey(publicKey); const csprName = - accountsInfo && accountsInfo[accountHash].csprName; + accountsInfo && accountsInfo[accountHash]?.csprName; return (