From f320f18067acae9bc9e70af26e55fe5663dfd3ef Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot 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. By: Nathan Adams --- .../bukkit/configuration/MemorySection.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/paper-api/src/main/java/org/bukkit/configuration/MemorySection.java b/paper-api/src/main/java/org/bukkit/configuration/MemorySection.java index ba41232fc7..8e16eb7ee5 100644 --- a/paper-api/src/main/java/org/bukkit/configuration/MemorySection.java +++ b/paper-api/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();