prevent accessing attributes of null

This commit is contained in:
ansuz 2017-07-12 18:56:04 +02:00
parent eeb2ee2d17
commit eda9908c3b

View File

@ -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) {