Avoid error when image couldn't be fetched
This commit is contained in:
parent
bf7df13855
commit
3ce4a1fee4
|
@ -59,7 +59,7 @@ class ExternalResource implements ICanReadFromStorage
|
||||||
} catch (Exception $exception) {
|
} catch (Exception $exception) {
|
||||||
throw new ReferenceStorageException(sprintf('External resource failed to get %s', $reference), $exception->getCode(), $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]);
|
Logger::debug('Got picture', ['Content-Type' => $fetchResult->getHeader('Content-Type'), 'uid' => $data->uid, 'url' => $data->url]);
|
||||||
return $fetchResult->getBody();
|
return $fetchResult->getBody();
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user