]> git.mxchange.org Git - friendica.git/commitdiff
Avoid error when image couldn't be fetched
authorMichael <heluecht@pirati.ca>
Sun, 11 Dec 2022 10:12:20 +0000 (10:12 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 11 Dec 2022 10:12:20 +0000 (10:12 +0000)
src/Core/Storage/Type/ExternalResource.php

index 34cd85edfb42c2c5e1cf3679c7b086de51e8c393..9ac116f71d77aa1bf13736c23cfd1616b9d06d9c 100644 (file)
@@ -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 {