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>
This commit is contained in:
@@ -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')));
|
||||
|
||||
Reference in New Issue
Block a user