summaryrefslogtreecommitdiffstats
path: root/src/main/java/org
diff options
context:
space:
mode:
authorsleak <sleak@sleak-PC>2011-12-16 09:23:53 -0800
committerNathan Adams <dinnerbone@dinnerbone.com>2011-12-19 16:13:07 +0000
commit28372908d7bc6716e19472a25024071a0705a129 (patch)
tree25277890451e87fb01bf259fb6b37996aa46c97e /src/main/java/org
parent72135a8e83774f492bd9cca49a8aa0b0cc4d222d (diff)
downloadbukkit-28372908d7bc6716e19472a25024071a0705a129.tar
bukkit-28372908d7bc6716e19472a25024071a0705a129.tar.gz
bukkit-28372908d7bc6716e19472a25024071a0705a129.tar.lz
bukkit-28372908d7bc6716e19472a25024071a0705a129.tar.xz
bukkit-28372908d7bc6716e19472a25024071a0705a129.zip
fix for BUKKIT-342 - getConfigurationSection returning the default section instead of creating a new section if defaults are present.
Diffstat (limited to 'src/main/java/org')
-rw-r--r--src/main/java/org/bukkit/configuration/MemorySection.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/main/java/org/bukkit/configuration/MemorySection.java b/src/main/java/org/bukkit/configuration/MemorySection.java
index a2eb99df..99c3e819 100644
--- a/src/main/java/org/bukkit/configuration/MemorySection.java
+++ b/src/main/java/org/bukkit/configuration/MemorySection.java
@@ -881,9 +881,13 @@ public class MemorySection implements ConfigurationSection {
if (path == null) {
throw new IllegalArgumentException("Path cannot be null");
}
-
- Object val = get(path, getDefault(path));
- return (val instanceof ConfigurationSection) ? (ConfigurationSection)val : null;
+
+ Object val = get(path, null);
+ if (val != null)
+ return (val instanceof ConfigurationSection) ? (ConfigurationSection)val : null;
+
+ val = get(path, getDefault(path));
+ return (val instanceof ConfigurationSection) ? createSection(path) : null;
}
public boolean isConfigurationSection(String path) {