diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2021-10-25 17:17:27 +0300 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2021-11-23 11:29:01 +0300 |
commit | 5a20e20e9ea9adbabe73afa5d2096575de5503ea (patch) | |
tree | e92f556646cd9fd6f12338451564ec6fad03eaf0 /core/Controller | |
parent | 8b271b8a123f0f0cbf3a3d81cf9cf3f99a2e642e (diff) |
Fix errors in AvatarController when data() returns null
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'core/Controller')
-rw-r--r-- | core/Controller/AvatarController.php | 5 |
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; |