From 03133fac9744494aecb4bc362be8bfc12bf3ba9a Mon Sep 17 00:00:00 2001 From: ElgarL Date: Mon, 6 Aug 2012 07:05:20 +0100 Subject: Ignore stupid plugins which add empty permission nodes. --- .../permissions/BukkitPermissions.java | 39 ++++++++++++---------- 1 file 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 result = new ArrayList(); for (String key : permList) { - String a = key.charAt(0) == '-' ? key.substring(1) : key; - Map allchildren = GroupManager.BukkitPermissions.getAllChildren(a, new HashSet()); - if (allchildren != null) { - - ListIterator 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 allchildren = GroupManager.BukkitPermissions.getAllChildren(a, new HashSet()); + if (allchildren != null) { + + ListIterator 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; -- cgit v1.2.3