Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.

Commit e9d6e24

Browse files
Show initials if stream is empty (#1125)
#1120
1 parent 80e4de0 commit e9d6e24

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/CommunityToolkit/Xamarin.CommunityToolkit/Views/AvatarView/AvatarView.shared.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ async void OnSourcePropertyChanged(bool isBindingContextChanged)
360360

361361
var stream = await getStreamAsync(uriImageSource, imageLoadingTokenSource.Token);
362362

363-
source = stream != null
363+
source = stream != null && stream != Stream.Null && stream.CanRead && stream.Length > 0
364364
? ImageSource.FromStream(async (token) => stream?.CanRead ?? true ? stream : (stream = await getStreamAsync(uriImageSource, token)))
365365
: null;
366366

0 commit comments

Comments
 (0)