Explorar o código

make sure engine exists before trying to use it

Raanan Weber %!s(int64=5) %!d(string=hai) anos
pai
achega
e41e4c8658
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      Playground/js/main.js

+ 1 - 1
Playground/js/main.js

@@ -220,7 +220,7 @@ class Main {
     constructor(parent) {
         this.parent = parent;
 
-        if (typeof BABYLON !== 'undefined') {
+        if (typeof BABYLON !== 'undefined' && BABYLON.Engine) {
             BABYLON.Engine.ShadersRepository = "/src/Shaders/";
         }
         this.snippetV3Url = "https://snippet.babylonjs.com"