diff --git a/src/utils/image-media.ts b/src/utils/image-media.ts index 1f1db27727..c3320627d0 100644 --- a/src/utils/image-media.ts +++ b/src/utils/image-media.ts @@ -92,7 +92,7 @@ export async function createThumbnail( context.drawImage(element, 0, 0, targetWidth, targetHeight); let thumbnailPromise: Promise; - if (canvas instanceof window.OffscreenCanvas) { + if (window.OffscreenCanvas && canvas instanceof window.OffscreenCanvas) { thumbnailPromise = canvas.convertToBlob({ type: mimeType }); } else { thumbnailPromise = new Promise(resolve => (canvas as HTMLCanvasElement).toBlob(resolve, mimeType));