diff options
author | ElgarL <ElgarL@palmergames.com> | 2012-01-18 01:25:25 +0000 |
---|---|---|
committer | ElgarL <ElgarL@palmergames.com> | 2012-01-18 01:25:25 +0000 |
commit | a40ec032499ed9e14da02924dc32394335d84483 (patch) | |
tree | a2325729bf66977b469d5b1d1daac910d90678e0 /EssentialsGroupManager | |
parent | 6676461f656f7a69ff973869aa7a26388e10178e (diff) | |
download | Essentials-a40ec032499ed9e14da02924dc32394335d84483.tar Essentials-a40ec032499ed9e14da02924dc32394335d84483.tar.gz Essentials-a40ec032499ed9e14da02924dc32394335d84483.tar.lz Essentials-a40ec032499ed9e14da02924dc32394335d84483.tar.xz Essentials-a40ec032499ed9e14da02924dc32394335d84483.zip |
Added a tidy error message for invalid permission entries in
GlobalGroups.
Diffstat (limited to 'EssentialsGroupManager')
-rw-r--r-- | EssentialsGroupManager/src/Changelog.txt | 3 | ||||
-rw-r--r-- | EssentialsGroupManager/src/org/anjocaido/groupmanager/GlobalGroups.java | 8 |
2 files changed, 8 insertions, 3 deletions
diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index 876dc28b7..741777748 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -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).
\ No newline at end of file + - 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.
\ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GlobalGroups.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GlobalGroups.java index f1bf10985..d9715d4be 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GlobalGroups.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GlobalGroups.java @@ -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);
|