Fix VelocityTomlConfig#set
This commit is contained in:
parent
11392b847b
commit
f0168224ad
1 changed files with 9 additions and 0 deletions
|
|
@ -60,6 +60,15 @@ public class VelocityTomlConfig implements ServerUtilsConfig {
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
config.remove(path);
|
config.remove(path);
|
||||||
} else {
|
} 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);
|
config.set(path, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue