summaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorstevenh <steven.hartland@multiplay.co.uk>2011-03-11 20:07:49 +0000
committerstevenh <steven.hartland@multiplay.co.uk>2011-03-11 20:07:49 +0000
commitc08b5f35585764b6cdc6d117e2f47b89435c1224 (patch)
treeaec831bb78e9e7c9a653e1e333fd7c810a61b470 /src/main/java
parentd733a32f7c2c48b872f9674bf12129b5b14079eb (diff)
downloadbukkit-c08b5f35585764b6cdc6d117e2f47b89435c1224.tar
bukkit-c08b5f35585764b6cdc6d117e2f47b89435c1224.tar.gz
bukkit-c08b5f35585764b6cdc6d117e2f47b89435c1224.tar.lz
bukkit-c08b5f35585764b6cdc6d117e2f47b89435c1224.tar.xz
bukkit-c08b5f35585764b6cdc6d117e2f47b89435c1224.zip
Fixed blank yaml config files throwing a null pointer exception
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/bukkit/util/config/Configuration.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/org/bukkit/util/config/Configuration.java b/src/main/java/org/bukkit/util/config/Configuration.java
index 427a94d1..3b5d95ab 100644
--- a/src/main/java/org/bukkit/util/config/Configuration.java
+++ b/src/main/java/org/bukkit/util/config/Configuration.java
@@ -115,7 +115,11 @@ public class Configuration extends ConfigurationNode {
@SuppressWarnings("unchecked")
private void read(Object input) throws ConfigurationException {
try {
- root = (Map<String, Object>)input;
+ if ( null == input ) {
+ root = new HashMap<String, Object>();
+ } else {
+ root = (Map<String, Object>)input;
+ }
} catch (ClassCastException e) {
throw new ConfigurationException("Root document must be an key-value structure");
}