diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2021-06-24 00:19:07 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2021-06-30 00:48:01 +0200 |
commit | 506227b5090edff883cb089aacd5bb65e8c1db03 (patch) | |
tree | e64f5763a88842431e0a2235a3e7f2155902f55d /lib/private/Avatar | |
parent | 02808e38b4a974b55d8c41b92599d9e13b954937 (diff) | |
download | nextcloud-server-506227b5090edff883cb089aacd5bb65e8c1db03.tar.gz nextcloud-server-506227b5090edff883cb089aacd5bb65e8c1db03.zip |
adjust internal data handling logic to fix store and load
- format as stored previously in oc_accounts table is kept
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'lib/private/Avatar')
-rw-r--r-- | lib/private/Avatar/AvatarManager.php | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/private/Avatar/AvatarManager.php b/lib/private/Avatar/AvatarManager.php index 83b2b4b5c3d..c3afd8094c7 100644 --- a/lib/private/Avatar/AvatarManager.php +++ b/lib/private/Avatar/AvatarManager.php @@ -39,6 +39,7 @@ use OC\KnownUser\KnownUserService; use OC\User\Manager; use OC\User\NoUserException; use OCP\Accounts\IAccountManager; +use OCP\Accounts\PropertyDoesNotExistException; use OCP\Files\IAppData; use OCP\Files\NotFoundException; use OCP\Files\NotPermittedException; @@ -126,9 +127,13 @@ class AvatarManager implements IAvatarManager { $folder = $this->appData->newFolder($userId); } - $account = $this->accountManager->getAccount($user); - $avatarProperties = $account->getProperty(IAccountManager::PROPERTY_AVATAR); - $avatarScope = $avatarProperties->getScope(); + try { + $account = $this->accountManager->getAccount($user); + $avatarProperties = $account->getProperty(IAccountManager::PROPERTY_AVATAR); + $avatarScope = $avatarProperties->getScope(); + } catch (PropertyDoesNotExistException $e) { + $avatarScope = ''; + } if ( // v2-private scope hides the avatar from public access and from unknown users |