summaryrefslogtreecommitdiffstats
path: root/EssentialsGroupManager/src
diff options
context:
space:
mode:
authorElgarL <ElgarL@palmergames.com>2012-01-14 15:48:55 +0000
committerElgarL <ElgarL@palmergames.com>2012-01-14 15:48:55 +0000
commitd0e5685ac0afb7bb69df9a17aafe0f78f5fc5aef (patch)
tree912f9680b84690d43d6814bb5c929e61d6eade03 /EssentialsGroupManager/src
parent768c92e5bfe42ae9acb4d3ecdb6ebe8777534b11 (diff)
downloadEssentials-d0e5685ac0afb7bb69df9a17aafe0f78f5fc5aef.tar
Essentials-d0e5685ac0afb7bb69df9a17aafe0f78f5fc5aef.tar.gz
Essentials-d0e5685ac0afb7bb69df9a17aafe0f78f5fc5aef.tar.lz
Essentials-d0e5685ac0afb7bb69df9a17aafe0f78f5fc5aef.tar.xz
Essentials-d0e5685ac0afb7bb69df9a17aafe0f78f5fc5aef.zip
Catch NullPointerErrors generated by blank permission nodes.
Diffstat (limited to 'EssentialsGroupManager/src')
-rw-r--r--EssentialsGroupManager/src/Changelog.txt3
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java14
2 files changed, 14 insertions, 3 deletions
diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt
index 364ae5952..2ed032267 100644
--- a/EssentialsGroupManager/src/Changelog.txt
+++ b/EssentialsGroupManager/src/Changelog.txt
@@ -99,4 +99,5 @@ v 1.8:
- Fix 'manucheckp' to correctly report if a permission is available from GroupManager or Bukkit.
- Changed over to a reflection method for populating superperms as Bukkit lags when you handle permissions one at a time.
- Major, MAJOR changes to support partial/full world mirroring.
- You can now mirror groups.yml, users.yml or both files between different worlds. \ No newline at end of file
+ You can now mirror groups.yml, users.yml or both files between different worlds.
+ - Catch NullPointerErrors generated by blank permission nodes. \ No newline at end of file
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java
index 73c4dca0f..c9c1d2b64 100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java
@@ -470,7 +470,12 @@ public class WorldDataHolder {
}
if (thisGroupNode.get("permissions") instanceof List) {
for (Object o : ((List) thisGroupNode.get("permissions"))) {
- thisGrp.addPermission(o.toString());
+ try {
+ thisGrp.addPermission(o.toString());
+ } catch (NullPointerException e) {
+ // Ignore this entry as it's null.
+ //throw new IllegalArgumentException("Invalid permission node in group: " + thisGrp.getName() + " in file: " + groupsFile.getPath());
+ }
}
} else if (thisGroupNode.get("permissions") instanceof String) {
thisGrp.addPermission((String) thisGroupNode.get("permissions"));
@@ -582,7 +587,12 @@ public class WorldDataHolder {
thisUser.addPermission(o.toString());
}
} else if (thisUserNode.get("permissions") instanceof String) {
- thisUser.addPermission(thisUserNode.get("permissions").toString());
+ try {
+ thisUser.addPermission(thisUserNode.get("permissions").toString());
+ } catch (NullPointerException e) {
+ // Ignore this entry as it's null.
+ //throw new IllegalArgumentException("Invalid permission node for user: " + thisUser.getName() + " in file: " + UserFile.getPath());
+ }
}
//SUBGROUPS LOADING