Allow non-existent pet-items nodes.

If someone spins up MobArena with a really old config-file or simply
removes the `pet-items` section, the plugin throws an NPE. This commit
fixes that by allowing the section to not exist.

It might be a good idea to log some helpful information, but let's wait
and see if this isn't good enough.

Fixes #606, closes #608.

Thanks Chew!
This commit is contained in:
Chew authored and Andreas Troelsen committed 2020-03-29 05:32:08 +02:00
1 parent 5369b1fbfa
commit c9b36f4993
2 files changed
+4

No files matched your search

@@ -280,6 +280,9 @@ public class ArenaMasterImpl implements ArenaMaster
spawnsPets.clear();
ConfigurationSection items = settings.getConfigurationSection("pet-items");
if (items == null) {
return;
}
for (String key : items.getKeys(false)) {
EntityType entity;