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

@ -103,4 +103,5 @@ v 1.8:
- Catch NullPointerErrors generated by blank permission nodes.
- 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).
- 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,8 +125,12 @@ public class GlobalGroups {
if (element != null)
if (element instanceof List) {
for (String node : (List<String>) element) {
newGroup.addPermission(node);
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);