diff --git a/packages/frontend/src/workers/draw-blurhash.ts b/packages/frontend/src/workers/draw-blurhash.ts index 6b5bb421f8..cbf8d39d72 100644 --- a/packages/frontend/src/workers/draw-blurhash.ts +++ b/packages/frontend/src/workers/draw-blurhash.ts @@ -6,9 +6,12 @@ onmessage = (event) => { if ('canvas' in event.data) { canvas = event.data.canvas; } - if (!(canvas && 'hash' in event.data && typeof event.data.hash === 'string')) { - console.error('Cannot draw blurhash without canvas and hash', canvas, event.data); - throw new Error('Cannot draw blurhash without canvas and hash'); + if (!canvas) { + console.error('Cannot draw blurhash without canvas', canvas, event.data); + throw new Error('Cannot draw blurhash without canvas'); + } + if (!('hash' in event.data && typeof event.data.hash === 'string')) { + return; } const width = event.data.width ?? 64; const height = event.data.height ?? 64;