diff --git a/src/com/garbagemule/MobArena/waves/WaveParser.java b/src/com/garbagemule/MobArena/waves/WaveParser.java index 6918e96..e956719 100644 --- a/src/com/garbagemule/MobArena/waves/WaveParser.java +++ b/src/com/garbagemule/MobArena/waves/WaveParser.java @@ -375,7 +375,12 @@ public class WaveParser } private static Map> getUpgradeMap(ConfigurationSection config) { - Set classes = config.getConfigurationSection("upgrades").getKeys(false); + ConfigurationSection section = config.getConfigurationSection("upgrades"); + if (section == null) { + return null; + } + + Set classes = section.getKeys(false); if (classes == null || classes.isEmpty()) { return null; } @@ -398,11 +403,11 @@ public class WaveParser } // New complex setup else if (val instanceof ConfigurationSection) { - ConfigurationSection section = (ConfigurationSection) val; + ConfigurationSection classSection = (ConfigurationSection) val; List list = new ArrayList(); // Items (Generic + Weapons) - itemList = section.getString("items", null); + itemList = classSection.getString("items", null); if (itemList != null) { for (ItemStack stack : ItemParser.parseItems(itemList)) { list.add(ArenaClass.isWeapon(stack) ? new WeaponUpgrade(stack) : new GenericUpgrade(stack)); @@ -410,7 +415,7 @@ public class WaveParser } // Armor - itemList = section.getString("armor", null); + itemList = classSection.getString("armor", null); if (itemList != null) { for (ItemStack stack : ItemParser.parseItems(itemList)) { list.add(new ArmorUpgrade(stack)); @@ -418,7 +423,7 @@ public class WaveParser } // Permissions - List perms = section.getStringList("permissions"); + List perms = classSection.getStringList("permissions"); if (!perms.isEmpty()) { for (String perm : perms) { list.add(new PermissionUpgrade(perm));