diff options
author | Lukas Hennig <lukas@wirsindwir.de> | 2016-04-16 16:08:35 +0200 |
---|---|---|
committer | md_5 <git@md-5.net> | 2016-04-17 11:13:14 +1000 |
commit | 2a1d9d6033c8d4734dc38b8f7d42e3a7101c354a (patch) | |
tree | 59667ab75263a41b350d866de0878889791dd2da /src/main/java | |
parent | 85107d1f3d607cd2a38926f3abaae7d6f376eead (diff) | |
download | bukkit-2a1d9d6033c8d4734dc38b8f7d42e3a7101c354a.tar bukkit-2a1d9d6033c8d4734dc38b8f7d42e3a7101c354a.tar.gz bukkit-2a1d9d6033c8d4734dc38b8f7d42e3a7101c354a.tar.lz bukkit-2a1d9d6033c8d4734dc38b8f7d42e3a7101c354a.tar.xz bukkit-2a1d9d6033c8d4734dc38b8f7d42e3a7101c354a.zip |
SPIGOT-2180: Empty ConfigurationSections created when removing value at end of path
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/bukkit/configuration/MemorySection.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/configuration/MemorySection.java b/src/main/java/org/bukkit/configuration/MemorySection.java index 3b92c644..1f4c8ce4 100644 --- a/src/main/java/org/bukkit/configuration/MemorySection.java +++ b/src/main/java/org/bukkit/configuration/MemorySection.java @@ -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; |