diff --git a/Velocity/src/main/java/net/frankheijden/serverutils/velocity/entities/VelocityTomlConfig.java b/Velocity/src/main/java/net/frankheijden/serverutils/velocity/entities/VelocityTomlConfig.java index 3b68643..a19c619 100644 --- a/Velocity/src/main/java/net/frankheijden/serverutils/velocity/entities/VelocityTomlConfig.java +++ b/Velocity/src/main/java/net/frankheijden/serverutils/velocity/entities/VelocityTomlConfig.java @@ -60,6 +60,15 @@ public class VelocityTomlConfig implements ServerUtilsConfig { if (value == null) { config.remove(path); } else { + int lastDotIndex = path.lastIndexOf('.'); + if (lastDotIndex != -1) { + String parentPath = path.substring(0, lastDotIndex); + try { + CommentedConfig parent = config.get(parentPath); + } catch (ClassCastException ex) { + config.remove(parentPath); + } + } config.set(path, value); } }