sebavan 5 лет назад
Родитель
Сommit
25fbad5450
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      src/Materials/Textures/renderTargetTexture.ts

+ 1 - 1
src/Materials/Textures/renderTargetTexture.ts

@@ -81,7 +81,7 @@ export class RenderTargetTexture extends Texture {
 
             var result = oldPush.apply(array, items);
 
-            if (wasEmpty) {
+            if (wasEmpty && this.getScene()) {
                 this.getScene()!.meshes.forEach((mesh) => {
                     mesh._markSubMeshesAsLightDirty();
                 });