mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2025-01-03 14:57:43 +01:00
Fixed NPE when there was no worlds-section in bukkit.yml
This commit is contained in:
parent
0fa8f4e824
commit
459aad2d2b
@ -57,9 +57,11 @@ public class WorldManager implements MVWorldManager {
|
|||||||
});
|
});
|
||||||
if (files.length == 1) {
|
if (files.length == 1) {
|
||||||
FileConfiguration bukkitConfig = YamlConfiguration.loadConfiguration(files[0]);
|
FileConfiguration bukkitConfig = YamlConfiguration.loadConfiguration(files[0]);
|
||||||
Set<String> keys = bukkitConfig.getConfigurationSection("worlds").getKeys(false);
|
if (bukkitConfig.isConfigurationSection("worlds")) {
|
||||||
for (String key : keys) {
|
Set<String> keys = bukkitConfig.getConfigurationSection("worlds").getKeys(false);
|
||||||
defaultGens.put(key, bukkitConfig.getString("worlds." + key + ".generator", ""));
|
for (String key : keys) {
|
||||||
|
defaultGens.put(key, bukkitConfig.getString("worlds." + key + ".generator", ""));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user