Skip to content

Commit

Permalink
Merge pull request #2486 from gtalha07/fix_rangeError-groupAvatarDM
Browse files Browse the repository at this point in the history
fix range error on empty members list (GroupAvatarDM)
  • Loading branch information
gnunicorn authored Jan 9, 2025
2 parents 3876e70 + e71168f commit ba3e63f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/lib/features/chat/widgets/room_avatar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,13 @@ class RoomAvatar extends ConsumerWidget {
return membersLoader.when(
data: (members) {
int count = members.length;

// handle empty list first, in case.
if (count == 0) {
return errorAvatar(
L10n.of(context)
.loadingMembersCountFailed('failed to fetched room: null'),
);
}
//Show member avatar
if (count == 1) {
return memberAvatar(members[0], ref);
Expand Down

0 comments on commit ba3e63f

Please sign in to comment.