From 0a4b0af93136a32b8c505264b82e592eecd6003b Mon Sep 17 00:00:00 2001 From: tastybento Date: Mon, 20 Apr 2020 13:46:58 -0700 Subject: [PATCH] Check that config sections exist before trying to copy them. --- src/main/java/world/bentobox/level/Level.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/world/bentobox/level/Level.java b/src/main/java/world/bentobox/level/Level.java index 3b615f5..f6b3f08 100644 --- a/src/main/java/world/bentobox/level/Level.java +++ b/src/main/java/world/bentobox/level/Level.java @@ -184,6 +184,7 @@ public class Level extends Addon { } private void copyConfigSection(YamlConfiguration blockConfig, String sectionName) { + if (!getConfig().isConfigurationSection(sectionName)) return; ConfigurationSection section = getConfig().getConfigurationSection(sectionName); for (String k:section.getKeys(true)) { blockConfig.set(sectionName + "." + k, section.get(k));