diff --git a/Plan/common/src/main/java/com/djrapitops/plan/system/settings/config/ConfigNode.java b/Plan/common/src/main/java/com/djrapitops/plan/system/settings/config/ConfigNode.java index ece41903d..97e0752cb 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/system/settings/config/ConfigNode.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/system/settings/config/ConfigNode.java @@ -160,14 +160,10 @@ public class ConfigNode { } ConfigNode moveFrom = found.get(); - ConfigNode moveTo = addNode(newPath); - ConfigNode oldParent = moveFrom.parent; - ConfigNode newParent = moveTo.parent; - oldParent.removeChild(moveFrom); moveTo.copyAll(moveFrom); - newParent.addChild(moveTo); + removeNode(oldPath); return getNode(newPath).isPresent(); } diff --git a/Plan/common/src/main/java/com/djrapitops/plan/system/settings/paths/key/TimeSetting.java b/Plan/common/src/main/java/com/djrapitops/plan/system/settings/paths/key/TimeSetting.java index 5dd630dd5..525f7dd16 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/system/settings/paths/key/TimeSetting.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/system/settings/paths/key/TimeSetting.java @@ -17,6 +17,7 @@ package com.djrapitops.plan.system.settings.paths.key; import com.djrapitops.plan.system.settings.config.ConfigNode; +import com.djrapitops.plugin.utilities.Verify; import java.util.concurrent.TimeUnit; import java.util.function.Predicate; @@ -46,6 +47,9 @@ public class TimeSetting extends Setting { } String unitName = node.getString(path + ".Unit"); try { + Verify.nullCheck(unitName, () -> new IllegalStateException( + "Config value for " + path + ".Unit has a bad value: 'null'" + )); TimeUnit unit = TimeUnit.valueOf(unitName.toUpperCase()); return unit.toMillis(duration); } catch (IllegalArgumentException e) {