From 3ce4a1fee43d81dca761adf690824abb9083f37a Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 11 Dec 2022 10:12:20 +0000 Subject: [PATCH] Avoid error when image couldn't be fetched --- src/Core/Storage/Type/ExternalResource.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Core/Storage/Type/ExternalResource.php b/src/Core/Storage/Type/ExternalResource.php index 34cd85edfb..9ac116f71d 100644 --- a/src/Core/Storage/Type/ExternalResource.php +++ b/src/Core/Storage/Type/ExternalResource.php @@ -59,7 +59,7 @@ class ExternalResource implements ICanReadFromStorage } catch (Exception $exception) { throw new ReferenceStorageException(sprintf('External resource failed to get %s', $reference), $exception->getCode(), $exception); } - if ($fetchResult->isSuccess()) { + if (!empty($fetchResult) && $fetchResult->isSuccess()) { Logger::debug('Got picture', ['Content-Type' => $fetchResult->getHeader('Content-Type'), 'uid' => $data->uid, 'url' => $data->url]); return $fetchResult->getBody(); } else {