Browse Source

Add safety check to deleting textures in nativeEngine.

Alex Tran 4 years ago
parent
commit
7bc7e69aee
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/Engines/nativeEngine.ts

+ 3 - 1
src/Engines/nativeEngine.ts

@@ -1503,7 +1503,9 @@ export class NativeEngine extends Engine {
     }
 
     protected _deleteTexture(texture: Nullable<WebGLTexture>): void {
-        this._native.deleteTexture(texture);
+        if (texture) {
+            this._native.deleteTexture(texture);
+        }
     }
 
     /**