浏览代码

check if not null before calling dispose

Trevor Baron 7 年之前
父节点
当前提交
d411e4e02e
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/Particles/babylon.particleSystem.ts

+ 1 - 1
src/Particles/babylon.particleSystem.ts

@@ -1771,7 +1771,7 @@
 
             this._removeFromRoot();
 
-            if (this._disposeEmitterOnDispose && !(<AbstractMesh>this.emitter).isDisposed) {
+            if (this._disposeEmitterOnDispose && this.emitter && !(this.emitter as AbstractMesh).isDisposed === false) {
                 (<AbstractMesh>this.emitter).dispose();
             }