Added a tidy error message for invalid permission entries in

GlobalGroups.
This commit is contained in:
ElgarL 2012-01-18 01:25:25 +00:00
parent 89c41b0508
commit 64af5b465d
2 changed files with 8 additions and 3 deletions

View file

@ -104,3 +104,4 @@ v 1.8:
- Removed '- bukkit.command' form the globalgroups permission nodes.
v 1.9:
- Optimize populating Bukkit perms so we no longer calculate the child nodes (Bukkit already does this).
- Added a tidy error message for invalid permission entries in GlobalGroups.

View file

@ -125,9 +125,13 @@ public class GlobalGroups {
if (element != null)
if (element instanceof List) {
try {
for (String node : (List<String>) element) {
newGroup.addPermission(node);
}
} catch (ClassCastException e) {
throw new IllegalArgumentException("Invalid permission node for global group: " + groupName);
}
} else if (element instanceof String) {
newGroup.addPermission((String) element);
} else