mirror of
https://github.com/BentoBoxWorld/Level.git
synced 2025-02-10 09:31:22 +01:00
Check that config sections exist before trying to copy them.
This commit is contained in:
parent
8788110a92
commit
0a4b0af931
@ -184,6 +184,7 @@ public class Level extends Addon {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void copyConfigSection(YamlConfiguration blockConfig, String sectionName) {
|
private void copyConfigSection(YamlConfiguration blockConfig, String sectionName) {
|
||||||
|
if (!getConfig().isConfigurationSection(sectionName)) return;
|
||||||
ConfigurationSection section = getConfig().getConfigurationSection(sectionName);
|
ConfigurationSection section = getConfig().getConfigurationSection(sectionName);
|
||||||
for (String k:section.getKeys(true)) {
|
for (String k:section.getKeys(true)) {
|
||||||
blockConfig.set(sectionName + "." + k, section.get(k));
|
blockConfig.set(sectionName + "." + k, section.get(k));
|
||||||
|
Loading…
Reference in New Issue
Block a user