From 63cd8b98ddbffbc85a2013f935a51d8dd794af34 Mon Sep 17 00:00:00 2001 From: Mae Thomson Date: Fri, 1 Mar 2024 11:06:23 -0500 Subject: [PATCH] Fix broken avatar thumbnail upon deleting last member of a group --- public/scripts/group-chats.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/public/scripts/group-chats.js b/public/scripts/group-chats.js index 1b6730f91..bb0775624 100644 --- a/public/scripts/group-chats.js +++ b/public/scripts/group-chats.js @@ -598,6 +598,11 @@ function getGroupAvatar(group) { return groupAvatar; } + // catch edge case where group had one member and that member is deleted + if (avatarCount === 0) { + return $('
'); + } + // default avatar const groupAvatar = $('#group_avatars_template .collage_1').clone(); groupAvatar.find('.img_1').attr('src', group.avatar_url || system_avatar);