]> source.dussan.org Git - nextcloud-server.git/commitdiff
Do not try to get the avatar if there is no user
authorRoeland Jago Douma <rullzer@owncloud.com>
Wed, 16 Dec 2015 19:51:56 +0000 (20:51 +0100)
committerMorris Jobke <hey@morrisjobke.de>
Thu, 17 Dec 2015 08:14:04 +0000 (09:14 +0100)
lib/private/templatelayout.php

index 1a6a07ddc9fb5049074e5e21166bfd7c5333681b..8522dbccc0098a922d3e624d613b235ca02c74f9 100644 (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');