From 3efe809d274f71c8b34e58b97255ea1d6a319f57 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Feb 2026 17:01:41 +0200 Subject: [PATCH] Guard `isValidImageUrl` against nullish `avatar_url` inputs (#5172) * Initial plan * fix: guard isValidImageUrl against nullish input Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com> --- public/scripts/group-chats.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/scripts/group-chats.js b/public/scripts/group-chats.js index c8a2bcb52..d54ec73aa 100644 --- a/public/scripts/group-chats.js +++ b/public/scripts/group-chats.js @@ -857,7 +857,7 @@ function updateGroupAvatar(group) { */ function isValidImageUrl(url) { // check if empty dict - if (Object.keys(url).length === 0) { + if (!url || Object.keys(url).length === 0) { return false; } return isDataURL(url) || (url && (url.startsWith('user') || url.startsWith('/user')));