fix(ui): Refactor UserDropdown.tsx to add safety check for user name

This commit is contained in:
Sabin Shrestha 2025-07-18 11:54:15 +05:45
parent abd06560a5
commit 014a161fe3

View file

@ -51,7 +51,7 @@ export function UserDropdown({
>
<Avatar className="h-8 w-8">
<AvatarImage src={user.avatar} alt={user.name} />
<AvatarFallback>{user.name.charAt(0).toUpperCase()}</AvatarFallback>
<AvatarFallback>{user.name.charAt(0)?.toUpperCase() || '?'}</AvatarFallback>
</Avatar>
</Button>
</DropdownMenuTrigger>