mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 03:43:40 +01:00
SPIGOT-2180: Empty ConfigurationSections created when removing value at end of path
By: Lukas Hennig <lukas@wirsindwir.de>
This commit is contained in:
parent
cbe5cc0768
commit
a64729191f
1 changed files with 4 additions and 0 deletions
|
@ -180,6 +180,10 @@ public class MemorySection implements ConfigurationSection {
|
|||
String node = path.substring(i2, i1);
|
||||
ConfigurationSection subSection = section.getConfigurationSection(node);
|
||||
if (subSection == null) {
|
||||
if (value == null) {
|
||||
// no need to create missing sub-sections if we want to remove the value:
|
||||
return;
|
||||
}
|
||||
section = section.createSection(node);
|
||||
} else {
|
||||
section = subSection;
|
||||
|
|
Loading…
Reference in a new issue