mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-24 17:22:55 +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);
|
String node = path.substring(i2, i1);
|
||||||
ConfigurationSection subSection = section.getConfigurationSection(node);
|
ConfigurationSection subSection = section.getConfigurationSection(node);
|
||||||
if (subSection == null) {
|
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);
|
section = section.createSection(node);
|
||||||
} else {
|
} else {
|
||||||
section = subSection;
|
section = subSection;
|
||||||
|
|
Loading…
Add table
Reference in a new issue