Explorar o código

check if not null before calling dispose

Trevor Baron %!s(int64=7) %!d(string=hai) anos
pai
achega
d411e4e02e
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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();
             }