From 310a2e55ebeb1e148989fc4a192fe67af8589396 Mon Sep 17 00:00:00 2001 From: "Lukas Rieger (Blue)" Date: Fri, 10 Feb 2023 17:02:15 +0100 Subject: [PATCH] Fix NullPointerException when trying to load textures from an empty textures.json file --- .../java/de/bluecolored/bluemap/core/map/TextureGallery.java | 1 + 1 file changed, 1 insertion(+) diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/TextureGallery.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/TextureGallery.java index d0d70bc6..d487e2e2 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/TextureGallery.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/TextureGallery.java @@ -69,6 +69,7 @@ public class TextureGallery { TextureGallery gallery = new TextureGallery(); try (Reader reader = new InputStreamReader(in)) { Texture[] textures = ResourcesGson.INSTANCE.fromJson(reader, Texture[].class); + if (textures == null) throw new IOException("Texture data is empty!"); gallery.nextId = textures.length; for (int ordinal = 0; ordinal < textures.length; ordinal++) { Texture texture = textures[ordinal];