1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-06 22:56:41 +02:00

Prevent null perms getting past the GlobalGroups loader.

This commit is contained in:
ElgarL
2012-04-18 22:22:35 +01:00
parent 59f6ca0239
commit df7db445b8
2 changed files with 5 additions and 2 deletions

View File

@@ -180,4 +180,5 @@ v 2.0:
- Update all code formatting to use tabs for indentation.
- Stop using our own deprecated methods as we tell others to do.
- Finally remove all deprecated methods.
- Re-initialize the WorldsHolder on a reload, as un-registering and re-registering a new holder means all plugins have to check for the new service on every quiery.
- Re-initialize the WorldsHolder on a reload, as un-registering and re-registering a new holder means all plugins have to check for the new service on every quiery.
- Prevent null perms getting past the GlobalGroups loader.

View File

@@ -159,12 +159,14 @@ public class GlobalGroups {
if (element instanceof List) {
try {
for (String node : (List<String>) element) {
newGroup.addPermission(node);
if ((node != null) && !node.isEmpty())
newGroup.addPermission(node);
}
} catch (ClassCastException ex) {
throw new IllegalArgumentException("Invalid permission node for global group: " + groupName, ex);
}
} else if (element instanceof String) {
if ((element != null) && !((String)element).isEmpty())
newGroup.addPermission((String) element);
} else
throw new IllegalArgumentException("Unknown type of permission node for global group: " + groupName);