summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-12-17 12:14:25 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2015-12-17 12:14:25 +0100
commit21bd19b6ae788b5e91ae654b3f1fc6a04612fd01 (patch)
treeacfb2de06c6c3ff86d783aa7a31558dd45b3bbe1 /lib/private
parentfa983caeaa6d04456d63099d26c0be144e343ac3 (diff)
parentdb95c8d51268db6ca17567743591c6e87b7a39d8 (diff)
downloadnextcloud-server-21bd19b6ae788b5e91ae654b3f1fc6a04612fd01.tar.gz
nextcloud-server-21bd19b6ae788b5e91ae654b3f1fc6a04612fd01.zip
Merge pull request #21241 from owncloud/fix_21226
Do not try to get the avatar if there is no user
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/templatelayout.php8
1 files changed, 7 insertions, 1 deletions
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');