From b4638efe2d0fe66365c48105fc8c8eb1705eccd3 Mon Sep 17 00:00:00 2001 From: yflory Date: Thu, 17 May 2018 12:09:52 +0200 Subject: [PATCH] Fix missing username when avatar is 404 --- 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 e085ea3a3..34a2be663 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -1166,9 +1166,9 @@ define([ var hexFileName = Util.base64ToHex(secret.channel); var src = Hash.getBlobPathFromHex(hexFileName); Common.getFileSize(hexFileName, function (e, data) { - if (e) { + if (e || !data) { displayDefault(); - return void console.error(e); + return void console.error(e || "404 avatar"); } if (typeof data !== "number") { return void displayDefault(); } if (Util.bytesToMegabytes(data) > 0.5) { return void displayDefault(); }