aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/library_gl.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/library_gl.js b/src/library_gl.js
index 467470bc..e67ec29b 100644
--- a/src/library_gl.js
+++ b/src/library_gl.js
@@ -833,6 +833,7 @@ var LibraryGL = {
for (var i = 0; i < n; i++) {
var id = {{{ makeGetValue('textures', 'i*4', 'i32') }}};
var texture = GL.textures[id];
+ if (!texture) continue;
GLctx.deleteTexture(texture);
texture.name = 0;
GL.textures[id] = null;