mirror of
https://github.com/MilkBowl/Vault.git
synced 2024-11-13 06:06:28 +01:00
fix NPE when the worldhandler doesn't exist for group checking.
Thanks Siguza
This commit is contained in:
parent
7f905ca57a
commit
6a04b59866
@ -299,6 +299,9 @@ public class Permission_GroupManager extends Permission {
|
||||
} else {
|
||||
handler = groupManager.getWorldsHolder().getWorldPermissions(worldName);
|
||||
}
|
||||
if (handler == null) {
|
||||
return null;
|
||||
}
|
||||
return handler.getGroups(playerName);
|
||||
}
|
||||
|
||||
@ -310,6 +313,9 @@ public class Permission_GroupManager extends Permission {
|
||||
} else {
|
||||
handler = groupManager.getWorldsHolder().getWorldPermissions(worldName);
|
||||
}
|
||||
if (handler == null) {
|
||||
return null;
|
||||
}
|
||||
return handler.getGroup(playerName);
|
||||
}
|
||||
|
||||
@ -357,7 +363,14 @@ public class Permission_GroupManager extends Permission {
|
||||
public String[] getGroups() {
|
||||
Set<String> groupNames = new HashSet<String>();
|
||||
for (World world : Bukkit.getServer().getWorlds()) {
|
||||
Collection<Group> groups = groupManager.getWorldsHolder().getWorldData(world.getName()).getGroupList();
|
||||
OverloadedWorldHolder owh = groupManager.getWorldsHolder().getWorldData(world.getName());
|
||||
if (owh == null) {
|
||||
continue;
|
||||
}
|
||||
Collection<Group> groups = owh.getGroupList();
|
||||
if (groups == null) {
|
||||
continue;
|
||||
}
|
||||
for (Group group : groups) {
|
||||
groupNames.add(group.getName());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user