Fix empty fetchResult curResult at Link::fetchMimeType (thx to Marco R.)
This commit is contained in:
parent
3110831131
commit
176af67e88
1 changed files with 5 additions and 1 deletions
|
@ -63,7 +63,11 @@ class ExternalResource implements ICanReadFromStorage
|
||||||
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 {
|
||||||
throw new ReferenceStorageException(sprintf('External resource failed to get %s', $reference), $fetchResult->getReturnCode(), new Exception($fetchResult->getBody()));
|
if (empty($fetchResult)) {
|
||||||
|
throw new ReferenceStorageException(sprintf('External resource failed to get %s', $reference));
|
||||||
|
} else {
|
||||||
|
throw new ReferenceStorageException(sprintf('External resource failed to get %s', $reference), $fetchResult->getReturnCode(), new Exception($fetchResult->getBody()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue