|
|
@@ -49,16 +49,15 @@ class ImageManager {
|
|
|
// Une image doit toujours avoir le time en options pour éviter les problèmes de cache
|
|
|
const query = [this.getCacheKey()]
|
|
|
|
|
|
- const response: Response = await this.apiRequestService.get(imageUrl, query)
|
|
|
- if (!response) {
|
|
|
- console.error('Error: image ' + id + ' not found')
|
|
|
- return defaultUrl
|
|
|
+ const blobPart = await this.apiRequestService.get(imageUrl, query);
|
|
|
+ if (!blobPart) {
|
|
|
+ console.error('Error: image ' + id + ' not found');
|
|
|
+ return defaultUrl;
|
|
|
}
|
|
|
|
|
|
- const blobPart = await response.blob()
|
|
|
- if (blobPart.size === 0) {
|
|
|
- console.error('Error: image ' + id + ' is invalid')
|
|
|
- return defaultUrl
|
|
|
+ if (!(blobPart instanceof Blob) || blobPart.size === 0) {
|
|
|
+ console.error('Error: image ' + id + ' is invalid');
|
|
|
+ return defaultUrl;
|
|
|
}
|
|
|
|
|
|
return await this.toBase64(blobPart)
|