From 5306baf3f4c381e8f13bae2c5bc6329a3c506548 Mon Sep 17 00:00:00 2001 From: shadcn Date: Wed, 30 Nov 2022 19:33:16 +0400 Subject: [PATCH] fix: issue with avatar when empty --- ui/avatar.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ui/avatar.tsx b/ui/avatar.tsx index 69c55bc..e9ab4b7 100644 --- a/ui/avatar.tsx +++ b/ui/avatar.tsx @@ -18,14 +18,20 @@ export function Avatar({ className, ...props }: AvatarProps) { } Avatar.Image = function AvatarImage({ + src, className, alt, width = 32, height = 32, ...props }: ImageProps) { + if (!src) { + return + } + return (