Handle error loading texture pack image without aborting texture pack

load
This commit is contained in:
Mike Primm 2022-08-14 12:46:43 -05:00
parent 0445814ef5
commit a6b56dc36e

View File

@ -1254,8 +1254,13 @@ public class TexturePack {
/* Load image */
if(is != null) {
ImageIO.setUseCache(false);
img = ImageIO.read(is);
if(img == null) { throw new FileNotFoundException(); }
try {
img = ImageIO.read(is);
} catch (IOException iox) {
}
if (img == null) {
Log.warning(String.format("Error loading image %s from module %s", fname, modid));
}
}
if(idx >= imgs.length) {
LoadedImage[] newimgs = new LoadedImage[idx+1];