Просмотр исходного кода

check if not null before calling dispose

Trevor Baron 7 лет назад
Родитель
Сommit
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();
             }