Skip to content

Commit 0fe7cf9

Browse files
committed
Add texture-key check. Fixes #53
1 parent ebbdd22 commit 0fe7cf9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resourcepack/BlockModelResource.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,6 @@ private BlockModelResource buildNoReset(String modelPath, boolean renderElements
269269

270270
for (Entry<Object, ? extends ConfigurationNode> entry : config.getNode("textures").getChildrenMap().entrySet()) {
271271
if (entry.getKey().equals(JSON_COMMENT)) continue;
272-
273272
textures.putIfAbsent(entry.getKey().toString(), entry.getValue().getString(null));
274273
}
275274

@@ -426,6 +425,8 @@ private Vector4f readVector4f(ConfigurationNode node) throws ParseResourceExcept
426425
}
427426

428427
private Texture getTexture(String key) throws NoSuchElementException, FileNotFoundException, IOException {
428+
if (key.isEmpty() || key.equals("#")) throw new NoSuchElementException("Empty texture key or name!");
429+
429430
if (key.charAt(0) == '#') {
430431
String value = textures.get(key.substring(1));
431432
if (value == null) throw new NoSuchElementException("There is no texture defined for the key " + key);

0 commit comments

Comments
 (0)