diff options
author | ElgarL <ElgarL@palmergames.com> | 2012-08-31 21:47:35 +0100 |
---|---|---|
committer | ElgarL <ElgarL@palmergames.com> | 2012-08-31 21:47:35 +0100 |
commit | 2a241041b119bf6888eebf3f2f7d1473b38fa0c9 (patch) | |
tree | baf5e043fd090ace3d40fb5e5aeb5caae148379d | |
parent | ee22f022899d8ceb3bffc2370c6e6333c13700c5 (diff) | |
download | Essentials-2a241041b119bf6888eebf3f2f7d1473b38fa0c9.tar Essentials-2a241041b119bf6888eebf3f2f7d1473b38fa0c9.tar.gz Essentials-2a241041b119bf6888eebf3f2f7d1473b38fa0c9.tar.lz Essentials-2a241041b119bf6888eebf3f2f7d1473b38fa0c9.tar.xz Essentials-2a241041b119bf6888eebf3f2f7d1473b38fa0c9.zip |
Give a better error when a subgroup is null.
-rw-r--r-- | EssentialsGroupManager/src/Changelog.txt | 3 | ||||
-rw-r--r-- | EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java | 12 |
2 files changed, 10 insertions, 5 deletions
diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index 2f535277b..78204d9b7 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -194,4 +194,5 @@ v 2.0: - Stop using the YamlConfiguration in bukkit for our config handling. We can now support periods in world names.
- Fix GlobalGroups not loading permission nodes.
- Fix an error with Logging set to 'OFF' triggering a cast exception.
- - No more null errors from corrupt config.yml's.
\ No newline at end of file + - No more null errors from corrupt config.yml's.
+ - Give a better error when a subgroup is null.
\ 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 3df3271a3..aad59e5aa 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java @@ -861,11 +861,15 @@ public class WorldDataHolder { */ } else if (nodeData instanceof List) { for (Object o : ((List) nodeData)) { - Group subGrp = ph.getGroup(o.toString()); - if (subGrp != null) { - thisUser.addSubGroup(subGrp); + if (o == null) { + GroupManager.logger.warning("Invalid Subgroup data for user: " + thisUser.getName() + ". Ignoring entry in file: " + usersFile.getPath()); } else { - GroupManager.logger.warning("Subgroup '" + o.toString() + "' not found for user: " + thisUser.getName() + ". Ignoring entry in file: " + usersFile.getPath()); + Group subGrp = ph.getGroup(o.toString()); + if (subGrp != null) { + thisUser.addSubGroup(subGrp); + } else { + GroupManager.logger.warning("Subgroup '" + o.toString() + "' not found for user: " + thisUser.getName() + ". Ignoring entry in file: " + usersFile.getPath()); + } } } } else if (nodeData instanceof String) { |