summaryrefslogtreecommitdiffstats
path: root/EssentialsGroupManager/src
diff options
context:
space:
mode:
authorElgarL <ElgarL@palmergames.com>2012-08-07 17:58:57 +0100
committerElgarL <ElgarL@palmergames.com>2012-08-07 17:58:57 +0100
commit72aeec58ed5f2bc2f4892ec6586e6791e3f19897 (patch)
treee1cb0a5f384d4291a158a78456bcbbbdcb30f9d9 /EssentialsGroupManager/src
parent3c5f9e16162aa66874911d052bdbe710ae1b1b8f (diff)
downloadEssentials-72aeec58ed5f2bc2f4892ec6586e6791e3f19897.tar
Essentials-72aeec58ed5f2bc2f4892ec6586e6791e3f19897.tar.gz
Essentials-72aeec58ed5f2bc2f4892ec6586e6791e3f19897.tar.lz
Essentials-72aeec58ed5f2bc2f4892ec6586e6791e3f19897.tar.xz
Essentials-72aeec58ed5f2bc2f4892ec6586e6791e3f19897.zip
Better error report on malformed GlobalGroups.
Diffstat (limited to 'EssentialsGroupManager/src')
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/GlobalGroups.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GlobalGroups.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GlobalGroups.java
index cc8181ddf..d0f5fed8b 100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GlobalGroups.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GlobalGroups.java
@@ -161,7 +161,11 @@ public class GlobalGroups {
Object element;
// Permission nodes
- element = ((Map<String, Object>)allGroups.get(groupName)).get("permissions");
+ try {
+ element = ((Map<String, Object>)allGroups.get(groupName)).get("permissions");
+ } catch ( Exception ex) {
+ throw new IllegalArgumentException("The GlobalGroup ' " + groupName + "' is formatted incorrectly: ", ex);
+ }
if (element != null)
if (element instanceof List) {
@@ -180,7 +184,11 @@ public class GlobalGroups {
throw new IllegalArgumentException("Unknown type of permission node for global group: " + groupName);
// Info nodes
- element = ((Map<String, Object>)allGroups.get(groupName)).get("info");
+ try {
+ element = ((Map<String, Object>)allGroups.get(groupName)).get("info");
+ } catch ( Exception ex) {
+ throw new IllegalArgumentException("The GlobalGroup ' " + groupName + "' is formatted incorrectly: ", ex);
+ }
if (element != null)
if (element instanceof MemorySection) {