From: Michael Date: Sun, 11 Dec 2022 10:12:20 +0000 (+0000) Subject: Avoid error when image couldn't be fetched X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=3ce4a1fee43d81dca761adf690824abb9083f37a;p=friendica.git Avoid error when image couldn't be fetched --- 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 {