13
0
geforkt von Mirrors/Paper

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

By: Lukas Hennig <lukas@wirsindwir.de>
Dieser Commit ist enthalten in:
Bukkit/Spigot 2016-04-16 16:08:35 +02:00
Ursprung cbe5cc0768
Commit a64729191f

Datei anzeigen

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