diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 555a229ae..885cf9d8f 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -120,6 +120,7 @@ Ben Kerman Euan Kemp Kieran Black XeR +Austin Siew ******************** diff --git a/ts/reviewer/image_occlusion.ts b/ts/reviewer/image_occlusion.ts index b0a83034b..319e27221 100644 --- a/ts/reviewer/image_occlusion.ts +++ b/ts/reviewer/image_occlusion.ts @@ -12,7 +12,11 @@ export function setupImageCloze(): void { } function setupImageClozeInner(): void { - const canvas: HTMLCanvasElement = document.querySelector("canvas")! as HTMLCanvasElement; + const canvas = document.querySelector("canvas") as HTMLCanvasElement | null; + if (canvas == null) { + return; + } + canvas.style.maxWidth = "100%"; canvas.style.maxHeight = "95vh";