Fix VelocityTomlConfig#set

This commit is contained in:
Frank van der Heijden 2021-08-04 00:59:11 +02:00
parent 11392b847b
commit f0168224ad
No known key found for this signature in database
GPG key ID: B808721C2DD5B5B8

View file

@ -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);
}
}