diff --git a/src/components/auth/AccountSwitcher.tsx b/src/components/auth/AccountSwitcher.tsx index a3d7b0c..5c71fd9 100644 --- a/src/components/auth/AccountSwitcher.tsx +++ b/src/components/auth/AccountSwitcher.tsx @@ -24,11 +24,11 @@ export function AccountSwitcher({ onAddAccountClick }: AccountSwitcherProps) { if (!currentUser) return null; const getDisplayName = (account: Account): string => { - return account.metadata.name ?? genUserName(account.pubkey); + return account.metadata?.name ?? genUserName(account.pubkey); } const getNip05 = (account: Account): string | undefined => { - return account.metadata.nip05; + return account.metadata?.nip05; } return ( @@ -37,7 +37,7 @@ export function AccountSwitcher({ onAddAccountClick }: AccountSwitcherProps) {