From 9e3ce5cd24d8414e58c9a0d701582e0a241c64ef Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Sun, 15 Jan 2012 09:04:08 +0000 Subject: [PATCH] Config .get*List will return an empty list of the appropriate type instead of null when the value does not exist. Thanks to krinsdeath for the PR. --- .../bukkit/configuration/MemorySection.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/java/org/bukkit/configuration/MemorySection.java b/src/main/java/org/bukkit/configuration/MemorySection.java index ba41232f..8e16eb7e 100644 --- a/src/main/java/org/bukkit/configuration/MemorySection.java +++ b/src/main/java/org/bukkit/configuration/MemorySection.java @@ -452,7 +452,7 @@ public class MemorySection implements ConfigurationSection { List list = getList(path); if (list == null) { - return null; + return new ArrayList(0); } List result = new ArrayList(); @@ -474,7 +474,7 @@ public class MemorySection implements ConfigurationSection { List list = getList(path); if (list == null) { - return null; + return new ArrayList(0); } List result = new ArrayList(); @@ -515,7 +515,7 @@ public class MemorySection implements ConfigurationSection { List list = getList(path); if (list == null) { - return null; + return new ArrayList(0); } List result = new ArrayList(); @@ -543,7 +543,7 @@ public class MemorySection implements ConfigurationSection { List list = getList(path); if (list == null) { - return null; + return new ArrayList(0); } List result = new ArrayList(); @@ -584,7 +584,7 @@ public class MemorySection implements ConfigurationSection { List list = getList(path); if (list == null) { - return null; + return new ArrayList(0); } List result = new ArrayList(); @@ -625,7 +625,7 @@ public class MemorySection implements ConfigurationSection { List list = getList(path); if (list == null) { - return null; + return new ArrayList(0); } List result = new ArrayList(); @@ -666,7 +666,7 @@ public class MemorySection implements ConfigurationSection { List list = getList(path); if (list == null) { - return null; + return new ArrayList(0); } List result = new ArrayList(); @@ -707,7 +707,7 @@ public class MemorySection implements ConfigurationSection { List list = getList(path); if (list == null) { - return null; + return new ArrayList(0); } List result = new ArrayList(); @@ -749,7 +749,7 @@ public class MemorySection implements ConfigurationSection { List list = getList(path); if (list == null) { - return null; + return new ArrayList(0); } List result = new ArrayList();