Procházet zdrojové kódy

Fix bug when the inspector is removed from the dispose tool in the inspector itself

Temechon před 8 roky
rodič
revize
4a6c9feaef
1 změnil soubory, kde provedl 5 přidání a 1 odebrání
  1. 5 1
      src/Debug/babylon.debugLayer.ts

+ 5 - 1
src/Debug/babylon.debugLayer.ts

@@ -46,7 +46,11 @@ module BABYLON {
 
 
         public hide() {
         public hide() {
             if (this._inspector) {
             if (this._inspector) {
-                this._inspector.dispose();
+                try {
+                    this._inspector.dispose();
+                } catch (e) {
+                    // If the inspector has been removed directly from the inspector tool
+                }
                 this._inspector = null;
                 this._inspector = null;
             }
             }
         }
         }