mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-23 17:47:34 +01:00
Prevent null perms getting past the GlobalGroups loader.
This commit is contained in:
parent
6ac8abdac8
commit
cd7bf5eff2
@ -181,3 +181,4 @@ v 2.0:
|
|||||||
- Stop using our own deprecated methods as we tell others to do.
|
- Stop using our own deprecated methods as we tell others to do.
|
||||||
- Finally remove all deprecated methods.
|
- 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.
|
@ -159,12 +159,14 @@ public class GlobalGroups {
|
|||||||
if (element instanceof List) {
|
if (element instanceof List) {
|
||||||
try {
|
try {
|
||||||
for (String node : (List<String>) element) {
|
for (String node : (List<String>) element) {
|
||||||
|
if ((node != null) && !node.isEmpty())
|
||||||
newGroup.addPermission(node);
|
newGroup.addPermission(node);
|
||||||
}
|
}
|
||||||
} catch (ClassCastException ex) {
|
} catch (ClassCastException ex) {
|
||||||
throw new IllegalArgumentException("Invalid permission node for global group: " + groupName, ex);
|
throw new IllegalArgumentException("Invalid permission node for global group: " + groupName, ex);
|
||||||
}
|
}
|
||||||
} else if (element instanceof String) {
|
} else if (element instanceof String) {
|
||||||
|
if ((element != null) && !((String)element).isEmpty())
|
||||||
newGroup.addPermission((String) element);
|
newGroup.addPermission((String) element);
|
||||||
} else
|
} else
|
||||||
throw new IllegalArgumentException("Unknown type of permission node for global group: " + groupName);
|
throw new IllegalArgumentException("Unknown type of permission node for global group: " + groupName);
|
||||||
|
Loading…
Reference in New Issue
Block a user