Browse Source

fix(renderTargetTexture) : Fix null texture error.

pierre 7 years ago
parent
commit
77b3516084
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/Materials/Textures/babylon.renderTargetTexture.ts

+ 3 - 0
src/Materials/Textures/babylon.renderTargetTexture.ts

@@ -496,6 +496,9 @@
         }
 
         protected unbindFrameBuffer(engine: Engine, faceIndex: number): void {
+            if (!this._texture) {
+                return;
+            }
             engine.unBindFramebuffer(this._texture, this.isCube, () => {
                 this.onAfterRenderObservable.notifyObservers(faceIndex);
             });