diff options
-rw-r--r-- | EssentialsGroupManager/src/Changelog.txt | 3 | ||||
-rw-r--r-- | EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java | 14 |
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 |