From eda9908c3bacea612fb3dced01f389a84a4ef833 Mon Sep 17 00:00:00 2001 From: ansuz Date: Wed, 12 Jul 2017 18:56:04 +0200 Subject: [PATCH] prevent accessing attributes of null --- www/common/cryptpad-common.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index 5974e5189..af5ef56ce 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -1719,7 +1719,9 @@ define([ if (account && !config.static && store) { var $avatar = $userAdmin.find('.buttonTitle'); var updateButton = function (newName) { - var url = store.getProfile().avatar; + var profile = store.getProfile(); + var url = profile && profile.avatar; + $avatar.html(''); common.displayAvatar($avatar, url, newName, function ($img) { if ($img) {