浏览代码

Merge pull request #8014 from ageneau/fix-closure

Fix issue when compiling with closure compiler.
David Catuhe 5 年之前
父节点
当前提交
2809dbd9c3
共有 2 个文件被更改,包括 6 次插入2 次删除
  1. 1 0
      dist/preview release/what's new.md
  2. 5 2
      src/Misc/depthReducer.ts

+ 1 - 0
dist/preview release/what's new.md

@@ -138,6 +138,7 @@
 - Fix bug in `ShaderMaterial` when using morph targets ([Popov72](https://github.com/Popov72)
 - Fix bug in playground where child NME windows would not close before page unload events ([belfortk](https://github.com/belfortk)
 - Fixed an issue with stereoscopic rendering ([#8000](https://github.com/BabylonJS/Babylon.js/issues/8000)) ([RaananW](https://github.com/RaananW))
+- Fix an error when compiling with the closure compiler ([ageneau](https://github.com/ageneau/))
 
 ## Breaking changes
 

+ 5 - 2
src/Misc/depthReducer.ts

@@ -98,11 +98,14 @@ export class DepthReducer extends MinMaxReducer {
         super.dispose(disposeAll);
 
         if (this._depthRenderer && disposeAll) {
-            delete this._depthRenderer.getDepthMap().getScene()?._depthRenderer[this._depthRendererId];
+            const scene = this._depthRenderer.getDepthMap().getScene();
+            if (scene) {
+                delete scene._depthRenderer[this._depthRendererId];
+            }
 
             this._depthRenderer.dispose();
             this._depthRenderer = null;
         }
     }
 
-}
+}