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,9 +57,11 @@ public class WorldManager implements MVWorldManager {
});
if (files.length == 1) {
FileConfiguration bukkitConfig = YamlConfiguration.loadConfiguration(files[0]);
Set<String> keys = bukkitConfig.getConfigurationSection("worlds").getKeys(false);
for (String key : keys) {
defaultGens.put(key, bukkitConfig.getString("worlds." + key + ".generator", ""));
if (bukkitConfig.isConfigurationSection("worlds")) {
Set<String> keys = bukkitConfig.getConfigurationSection("worlds").getKeys(false);
for (String key : keys) {
defaultGens.put(key, bukkitConfig.getString("worlds." + key + ".generator", ""));
}
}
}
}