From: Roeland Jago Douma Date: Wed, 16 Dec 2015 19:51:56 +0000 (+0100) Subject: Do not try to get the avatar if there is no user X-Git-Tag: v9.0beta1~477^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=db95c8d51268db6ca17567743591c6e87b7a39d8;p=nextcloud-server.git Do not try to get the avatar if there is no user --- diff --git a/lib/private/templatelayout.php b/lib/private/templatelayout.php index 1a6a07ddc9f..8522dbccc00 100644 --- a/lib/private/templatelayout.php +++ b/lib/private/templatelayout.php @@ -136,7 +136,13 @@ class OC_TemplateLayout extends OC_Template { $this->assign('user_uid', OC_User::getUser()); $this->assign('appsmanagement_active', $appsMgmtActive); $this->assign('enableAvatars', $this->config->getSystemValue('enable_avatars', true)); - $this->assign('userAvatarSet', \OC_Helper::userAvatarSet(OC_User::getUser())); + + if (OC_User::getUser() === false) { + $this->assign('userAvatarSet', false); + } else { + $this->assign('userAvatarSet', \OC::$server->getAvatarManager()->getAvatar(OC_User::getUser())->exists()); + } + } else if ($renderAs == 'error') { parent::__construct('core', 'layout.guest', '', false); $this->assign('bodyid', 'body-login');