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 name: MobArena
author: garbagemule author: garbagemule
main: com.garbagemule.MobArena.MobArena main: com.garbagemule.MobArena.MobArena
version: 0.96.2.3 version: 0.96.2.4
softdepend: [Multiverse-Core,Towny,Heroes,MagicSpells,Vault] softdepend: [Multiverse-Core,Towny,Heroes,MagicSpells,Vault]
commands: commands:
ma: ma:

View File

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