diff --git a/proxy/src/main/java/net/md_5/bungee/config/YamlConfig.java b/proxy/src/main/java/net/md_5/bungee/config/YamlConfig.java index 7f676993..43eff1a9 100644 --- a/proxy/src/main/java/net/md_5/bungee/config/YamlConfig.java +++ b/proxy/src/main/java/net/md_5/bungee/config/YamlConfig.java @@ -96,7 +96,7 @@ public class YamlConfig implements ConfigurationAdapter if (index == -1) { Object val = submap.get(path); - if (val == null) + if (val == null && def != null) { val = def; submap.put(path, def); @@ -193,8 +193,8 @@ public class YamlConfig implements ConfigurationAdapter @SuppressWarnings("unchecked") public Collection getGroups(String player) { - Collection groups = get("groups." + player, Collections.EMPTY_LIST); - Collection ret = new HashSet<>(groups); + Collection groups = get("groups." + player, null); + Collection ret = (groups == null) ? new HashSet() : new HashSet<>(groups); ret.add("default"); return ret; } @@ -203,6 +203,6 @@ public class YamlConfig implements ConfigurationAdapter @SuppressWarnings("unchecked") public Collection getPermissions(String group) { - return get("permissions." + group, Collections.EMPTY_SET); + return get("permissions." + group, Collections.EMPTY_LIST); } }