Przeglądaj źródła

check if not null before calling dispose

Trevor Baron 7 lat temu
rodzic
commit
d411e4e02e
1 zmienionych plików z 1 dodań i 1 usunięć
  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();
             }