Only remove if parent member is object
This commit is contained in:
parent
d2928b4a04
commit
c1a6fe269e
1 changed files with 3 additions and 1 deletions
|
|
@ -166,7 +166,9 @@ public class JsonConfig implements ServerUtilsConfig {
|
|||
if (lastDotIndex == -1) {
|
||||
object = config;
|
||||
} else {
|
||||
object = ((JsonConfig) get(path.substring(0, lastDotIndex))).config;
|
||||
Object obj = get(path.substring(0, lastDotIndex));
|
||||
if (!(obj instanceof JsonConfig)) return;
|
||||
object = ((JsonConfig) obj).config;
|
||||
}
|
||||
|
||||
object.remove(path.substring(lastDotIndex + 1));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue