diff options
author | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2020-12-14 19:09:08 +0300 |
---|---|---|
committer | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2020-12-14 19:09:08 +0300 |
commit | 6e43ce76bd807da9cf91782b795e459b6d901d34 (patch) | |
tree | ae18e18947fc547efa06fd24d481176b4b2b3c30 | |
parent | 1e133099e5dd080b59ccf4f4237e7de20865b01e (diff) |
fixup! Add OCS endpoint for avatars
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
-rw-r--r-- | core/Controller/GenericAvatarController.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/core/Controller/GenericAvatarController.php b/core/Controller/GenericAvatarController.php index 4761729507b..816b66a3b93 100644 --- a/core/Controller/GenericAvatarController.php +++ b/core/Controller/GenericAvatarController.php @@ -31,6 +31,7 @@ use OCP\AppFramework\Http; use OCP\AppFramework\Http\DataResponse; use OCP\AppFramework\Http\FileDisplayResponse; use OCP\AppFramework\Http\Response; +use OCP\Files\NotFoundException; use OCP\IAvatarManager; use OCP\IL10N; use OCP\IRequest; @@ -86,7 +87,12 @@ class GenericAvatarController extends OCSController { 'X-NC-IsCustomAvatar' => $avatar->isCustomAvatar() ? '1' : '0', ] ); + } catch (\InvalidArgumentException $e) { + return new DataResponse([], Http::STATUS_NOT_FOUND); + } catch (NotFoundException $e) { + return new DataResponse([], Http::STATUS_NOT_FOUND); } catch (\Exception $e) { + $this->logger->error('Error when getting avatar', ['app' => 'core', 'exception' => $e]); return new DataResponse([], Http::STATUS_NOT_FOUND); } |