Fix NPE on missing, but expected, monster maps.

This commit is contained in:
garbagemule 2014-01-25 13:56:31 +01:00
parent d866ec50af
commit 97e5dd0b63
2 changed files with 7 additions and 2 deletions

View File

@ -1,7 +1,7 @@
name: MobArena
author: garbagemule
main: com.garbagemule.MobArena.MobArena
version: 0.96.2.3
version: 0.96.2.4
softdepend: [Multiverse-Core,Towny,Heroes,MagicSpells,Vault]
commands:
ma:

View File

@ -318,7 +318,12 @@ public class WaveParser
* @return a "reverse" map of monsters and numbers
*/
private static SortedMap<Integer,MACreature> getMonsterMap(ConfigurationSection config) {
Set<String> monsters = config.getConfigurationSection("monsters").getKeys(false);
ConfigurationSection section = config.getConfigurationSection("monsters");
if (section == null) {
return null;
}
Set<String> monsters = section.getKeys(false);
if (monsters == null || monsters.isEmpty()) {
return null;
}