Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2020-12-14 19:09:08 +0300
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2020-12-14 19:09:08 +0300
commit6e43ce76bd807da9cf91782b795e459b6d901d34 (patch)
treeae18e18947fc547efa06fd24d481176b4b2b3c30
parent1e133099e5dd080b59ccf4f4237e7de20865b01e (diff)
fixup! Add OCS endpoint for avatars
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
-rw-r--r--core/Controller/GenericAvatarController.php6
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);
}