diff --git a/source/SkiaSharp.Views.Uno/SkiaSharp.Views.Uno.WinUI.Wasm/WasmScripts/SkiaSharp.Views.Uno.Wasm.js b/source/SkiaSharp.Views.Uno/SkiaSharp.Views.Uno.WinUI.Wasm/WasmScripts/SkiaSharp.Views.Uno.Wasm.js index b7f80f4bd4..8bb78cd85c 100644 --- a/source/SkiaSharp.Views.Uno/SkiaSharp.Views.Uno.WinUI.Wasm/WasmScripts/SkiaSharp.Views.Uno.Wasm.js +++ b/source/SkiaSharp.Views.Uno/SkiaSharp.Views.Uno.WinUI.Wasm/WasmScripts/SkiaSharp.Views.Uno.Wasm.js @@ -10,6 +10,11 @@ static invalidateCanvas(pData, canvasId, width, height) { var htmlCanvas = document.getElementById(canvasId); + + if (!htmlCanvas) { + return false; + } + htmlCanvas.width = width; htmlCanvas.height = height;