浏览代码

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

Temechon 8 年之前
父节点
当前提交
4a6c9feaef
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      src/Debug/babylon.debugLayer.ts

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

@@ -46,7 +46,11 @@ module BABYLON {
 
         public hide() {
             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;
             }
         }