Skip to content

Commit 7f9951d

Browse files
authored
fix(skxamlcanvas): [Wasm] Don't fail when the canvas can't be found (#2563)
1 parent d5bcfdf commit 7f9951d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

source/SkiaSharp.Views.Uno/SkiaSharp.Views.Uno.WinUI.Wasm/WasmScripts/SkiaSharp.Views.Uno.Wasm.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010

1111
static invalidateCanvas(pData, canvasId, width, height) {
1212
var htmlCanvas = document.getElementById(canvasId);
13+
14+
if (!htmlCanvas) {
15+
return false;
16+
}
17+
1318
htmlCanvas.width = width;
1419
htmlCanvas.height = height;
1520

0 commit comments

Comments
 (0)