summaryrefslogtreecommitdiffstats
path: root/EssentialsGroupManager/src/org/anjocaido
diff options
context:
space:
mode:
authorElgarL <ElgarL@palmergames.com>2012-08-06 07:05:20 +0100
committerElgarL <ElgarL@palmergames.com>2012-08-06 07:05:20 +0100
commita7a06963ac34807ab9a6149a22a6f7ea717b54a2 (patch)
tree827b336e7cdf1131b899aeb65e4cc11f45413ef1 /EssentialsGroupManager/src/org/anjocaido
parent73fb2d3735e6c4db4ca2e7bd61b163ad359ce25f (diff)
downloadEssentials-a7a06963ac34807ab9a6149a22a6f7ea717b54a2.tar
Essentials-a7a06963ac34807ab9a6149a22a6f7ea717b54a2.tar.gz
Essentials-a7a06963ac34807ab9a6149a22a6f7ea717b54a2.tar.lz
Essentials-a7a06963ac34807ab9a6149a22a6f7ea717b54a2.tar.xz
Essentials-a7a06963ac34807ab9a6149a22a6f7ea717b54a2.zip
Ignore stupid plugins which add empty permission nodes.
Diffstat (limited to 'EssentialsGroupManager/src/org/anjocaido')
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java39
1 files changed, 22 insertions, 17 deletions
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java
index 6b81f17d0..a4ddcf279 100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java
@@ -214,26 +214,31 @@ public class BukkitPermissions {
List<String> result = new ArrayList<String>();
for (String key : permList) {
- String a = key.charAt(0) == '-' ? key.substring(1) : key;
- Map<String, Boolean> allchildren = GroupManager.BukkitPermissions.getAllChildren(a, new HashSet<String>());
- if (allchildren != null) {
-
- ListIterator<String> itr = result.listIterator();
-
- while (itr.hasNext()) {
- String node = (String) itr.next();
- String b = node.charAt(0) == '-' ? node.substring(1) : node;
-
- // Insert the parent node before the child
- if (allchildren.containsKey(b)) {
- itr.set(key);
- itr.add(node);
- break;
+ /*
+ * Ignore stupid plugins which add empty permission nodes.
+ */
+ if (!key.isEmpty()) {
+ String a = key.charAt(0) == '-' ? key.substring(1) : key;
+ Map<String, Boolean> allchildren = GroupManager.BukkitPermissions.getAllChildren(a, new HashSet<String>());
+ if (allchildren != null) {
+
+ ListIterator<String> itr = result.listIterator();
+
+ while (itr.hasNext()) {
+ String node = (String) itr.next();
+ String b = node.charAt(0) == '-' ? node.substring(1) : node;
+
+ // Insert the parent node before the child
+ if (allchildren.containsKey(b)) {
+ itr.set(key);
+ itr.add(node);
+ break;
+ }
}
}
+ if (!result.contains(key))
+ result.add(key);
}
- if (!result.contains(key))
- result.add(key);
}
return result;