aboutsummaryrefslogtreecommitdiffstats
path: root/core/Controller/AvatarController.php
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2021-10-25 16:17:27 +0200
committerCôme Chilliet <come.chilliet@nextcloud.com>2021-11-23 09:29:01 +0100
commit5a20e20e9ea9adbabe73afa5d2096575de5503ea (patch)
treee92f556646cd9fd6f12338451564ec6fad03eaf0 /core/Controller/AvatarController.php
parent8b271b8a123f0f0cbf3a3d81cf9cf3f99a2e642e (diff)
downloadnextcloud-server-5a20e20e9ea9adbabe73afa5d2096575de5503ea.tar.gz
nextcloud-server-5a20e20e9ea9adbabe73afa5d2096575de5503ea.zip
Fix errors in AvatarController when data() returns null
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'core/Controller/AvatarController.php')
-rw-r--r--core/Controller/AvatarController.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/Controller/AvatarController.php b/core/Controller/AvatarController.php
index 3b87bf15b2f..5acfe9cd404 100644
--- a/core/Controller/AvatarController.php
+++ b/core/Controller/AvatarController.php
@@ -283,11 +283,12 @@ class AvatarController extends Controller {
$image = new \OC_Image();
$image->loadFromData($tmpAvatar);
- $resp = new DataDisplayResponse($image->data(),
+ $resp = new DataDisplayResponse(
+ $image->data() ?? '',
Http::STATUS_OK,
['Content-Type' => $image->mimeType()]);
- $resp->setETag((string)crc32($image->data()));
+ $resp->setETag((string)crc32($image->data() ?? ''));
$resp->cacheFor(0);
$resp->setLastModified(new \DateTime('now', new \DateTimeZone('GMT')));
return $resp;