Improve error if canvas is null or undefined
@@ -214,6 +214,9 @@ var BABYLON;
// // Do nothing
//}
if (!this._gl) {
+ if (!canvas) {
+ throw new Error("The provided canvas is null or undefined.");
+ }
try {
this._gl = (canvas.getContext("webgl", options) || canvas.getContext("experimental-webgl", options));
}
@@ -518,6 +518,9 @@
this._gl = <WebGLRenderingContext>(canvas.getContext("webgl", options) || canvas.getContext("experimental-webgl", options));
} catch (e) {