Do not try to get the avatar if there is no user

This commit is contained in:
Roeland Jago Douma 2015-12-16 20:51:56 +01:00 committed by Morris Jobke
parent 1d932e4c98
commit db95c8d512

View file

@ -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');