Fixed NPE when there was no worlds-section in bukkit.yml

This commit is contained in:
main() 2011-11-26 12:06:50 +01:00
parent 0fa8f4e824
commit 459aad2d2b

View File

@ -57,12 +57,14 @@ public class WorldManager implements MVWorldManager {
});
if (files.length == 1) {
FileConfiguration bukkitConfig = YamlConfiguration.loadConfiguration(files[0]);
if (bukkitConfig.isConfigurationSection("worlds")) {
Set<String> keys = bukkitConfig.getConfigurationSection("worlds").getKeys(false);
for (String key : keys) {
defaultGens.put(key, bukkitConfig.getString("worlds." + key + ".generator", ""));
}
}
}
}
/**
* {@inheritDoc}