From 835f531c9eb6233b78d6ae96d46501ce4c9449ca Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 9 Mar 2020 10:55:52 +0100 Subject: [PATCH] Fix avatar issues --- www/common/common-ui-elements.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index 2e41a8f21..f407826e9 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -2826,13 +2826,13 @@ define([ }; UIElements.displayAvatar = function (common, $container, href, name, cb) { var displayDefault = function () { - var text = typeof(href) === "string" ? href : getFirstEmojiOrCharacter(name); + var text = (href && typeof(href) === "string") ? href : getFirstEmojiOrCharacter(name); var $avatar = $('', {'class': 'cp-avatar-default'}).text(text); $container.append($avatar); if (cb) { cb(); } }; if (!window.Symbol) { return void displayDefault(); } // IE doesn't have Symbol - if (typeof(href) !== "string" || href.length === 1) { return void displayDefault(); } + if (!href || href.length === 1) { return void displayDefault(); } var centerImage = function ($img, $image, img) { var w = img.width;