diff Platforms/Wasm/wasm-viewport.ts @ 244:313903066093 am

cleanup
author am@osimis.io
date Wed, 20 Jun 2018 14:56:52 +0200
parents f73d722d98c8
children 8bdc6112bc2e
line wrap: on
line diff
--- a/Platforms/Wasm/wasm-viewport.ts	Wed Jun 20 14:27:06 2018 +0200
+++ b/Platforms/Wasm/wasm-viewport.ts	Wed Jun 20 14:56:52 2018 +0200
@@ -65,6 +65,9 @@
       this.module_ = module;
       this.canvasId_ = canvasId;
       this.htmlCanvas_ = document.getElementById(this.canvasId_) as HTMLCanvasElement;
+      if (this.htmlCanvas_ == null) {
+        console.log("Can not create WasmViewport, did not find the canvas whose id is '", this.canvasId_, "'");
+      }
       this.context_ = this.htmlCanvas_.getContext('2d');
 
       this.ViewportSetSize = this.module_.cwrap('ViewportSetSize', null, [ 'number', 'number', 'number' ]);