diff options
author | Roeland Jago Douma <rullzer@owncloud.com> | 2016-02-22 09:55:29 +0100 |
---|---|---|
committer | Roeland Jago Douma <rullzer@owncloud.com> | 2016-02-22 10:14:14 +0100 |
commit | fe08b5e9d902c9dc2891c59cf7e8d3bcb2700150 (patch) | |
tree | 0238b7705748bd4d7e7bad4d9cb384cba1fa4103 /settings/controller | |
parent | 8a8209796d4577644228121edc2231ae027217c7 (diff) | |
download | nextcloud-server-fe08b5e9d902c9dc2891c59cf7e8d3bcb2700150.tar.gz nextcloud-server-fe08b5e9d902c9dc2891c59cf7e8d3bcb2700150.zip |
We should check for exceptions when trying to get the avatar
Fixes #22550
* Updated phpdoc of avatatmanager
* Add unit test
Diffstat (limited to 'settings/controller')
-rw-r--r-- | settings/controller/userscontroller.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/settings/controller/userscontroller.php b/settings/controller/userscontroller.php index 3e5455751ab..0abcabed11c 100644 --- a/settings/controller/userscontroller.php +++ b/settings/controller/userscontroller.php @@ -176,7 +176,11 @@ class UsersController extends Controller { $avatarAvailable = false; if ($this->config->getSystemValue('enable_avatars', true) === true) { - $avatarAvailable = $this->avatarManager->getAvatar($user->getUID())->exists(); + try { + $avatarAvailable = $this->avatarManager->getAvatar($user->getUID())->exists(); + } catch (\Exception $e) { + //No avatar yet + } } return [ |