don't crash TextureAtlas.repack when empty

This commit is contained in:
DaniTheSkunk 2022-12-17 13:07:38 +00:00
parent 0bc2be66b3
commit 1d32ce757f
1 changed files with 4 additions and 0 deletions

View File

@ -70,6 +70,10 @@ class TextureAtlas {
int y = 0; int y = 0;
int height; int height;
if(textures.isEmpty()) {
return;
}
textures.sort(new TextureHeightComparator().reversed()); textures.sort(new TextureHeightComparator().reversed());
height = textures.get(0).getImg().getHeight(); height = textures.get(0).getImg().getHeight();