diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/bukkit/configuration/MemorySection.java | 10 |
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) { |