Browse Source

Engine: null check on _bindIndexBufferWithCache to make unindexed draws working again

nockawa 8 years ago
parent
commit
a56f4a57cd
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/babylon.engine.ts

+ 3 - 0
src/babylon.engine.ts

@@ -1385,6 +1385,9 @@
         }
 
         private _bindIndexBufferWithCache(indexBuffer: WebGLBuffer): void {            
+            if (indexBuffer == null) {
+                return;
+            }
             if (this._cachedIndexBuffer !== indexBuffer) {
                 this._cachedIndexBuffer = indexBuffer;
                 this.bindIndexBuffer(indexBuffer);