Skip to content

Commit

Permalink
Fix null checks for accessing csprName properties.
Browse files Browse the repository at this point in the history
  • Loading branch information
ost-ptk committed Nov 25, 2024
1 parent f9fc016 commit ecabf24
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/apps/connect-to-app/pages/switch-account/content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<ListItemContainer key={account.name}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export const UnconnectedAccountsList = ({
renderRow={(unconnectedAccount, index) => {
const csprName =
accountsInfo &&
accountsInfo[unconnectedAccount.accountHash].csprName;
accountsInfo[unconnectedAccount.accountHash]?.csprName;

return (
<ListItemContainer key={unconnectedAccount.name}>
Expand Down
2 changes: 1 addition & 1 deletion src/apps/popup/pages/connected-sites/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export function ConnectedSitesPage() {
const accountHash = getAccountHashFromPublicKey(publicKey);

const csprName =
accountsInfo && accountsInfo[accountHash].csprName;
accountsInfo && accountsInfo[accountHash]?.csprName;

return (
<SiteGroupItem
Expand Down

0 comments on commit ecabf24

Please sign in to comment.