Browse Source

Update textureTools.ts

aWeirdo 4 years ago
parent
commit
3eea4243bf
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/Misc/textureTools.ts

+ 4 - 0
src/Misc/textureTools.ts

@@ -89,6 +89,10 @@ export class TextureTools {
         }
 
         var pixels = texture.readPixels(faceIndex, level);
+        if (!pixels) {
+            return null;
+        }
+        
         var size = texture.getSize();
         var width = size.width;
         var height = size.height;