mirror of
https://github.com/nextcloud/server.git
synced 2026-04-20 22:00:39 -04:00
Fix errors in AvatarController when data() returns null
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
parent
8b271b8a12
commit
5a20e20e9e
1 changed files with 3 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue