1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-09-30 16:19:11 +02:00

Fixed an error on 'manucheckv'. If the users doesn't have the variable

it fell through causing an exception.
Added checking of subgroups for Info nodes.
This commit is contained in:
ElgarL
2011-10-31 20:07:21 +00:00
parent 3f2916967d
commit 9734274ed1
3 changed files with 50 additions and 10 deletions

View File

@@ -1176,11 +1176,17 @@ public class GroupManager extends JavaPlugin {
}
// VALIDANDO PERMISSAO
auxGroup = auxUser.getGroup();
auxGroup2 = permissionHandler.nextGroupWithVariable(auxGroup, args[1], null);
auxGroup2 = permissionHandler.nextGroupWithVariable(auxGroup, args[1]);
if (!auxUser.getVariables().hasVar(args[1])) {
// Check sub groups
if (!auxUser.isSubGroupsEmpty() && auxGroup2 == null)
for (Group subGroup : auxUser.subGroupListCopy()) {
auxGroup2 = permissionHandler.nextGroupWithVariable(subGroup, args[1]);
}
if (auxGroup2 == null) {
sender.sendMessage(ChatColor.RED + "The user doesn't have access to that variable!");
return false;
}
}
// PARECE OK