SPIGOT-2180: Empty ConfigurationSections created when removing value at end of path

By: Lukas Hennig <lukas@wirsindwir.de>
This commit is contained in:
Bukkit/Spigot 2016-04-16 16:08:35 +02:00
parent cbe5cc0768
commit a64729191f

View file

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