mirror of
https://github.com/MilkBowl/Vault.git
synced 2024-12-03 16:04:12 +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 {
|
} else {
|
||||||
handler = groupManager.getWorldsHolder().getWorldPermissions(worldName);
|
handler = groupManager.getWorldsHolder().getWorldPermissions(worldName);
|
||||||
}
|
}
|
||||||
|
if (handler == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return handler.getGroups(playerName);
|
return handler.getGroups(playerName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -310,6 +313,9 @@ public class Permission_GroupManager extends Permission {
|
|||||||
} else {
|
} else {
|
||||||
handler = groupManager.getWorldsHolder().getWorldPermissions(worldName);
|
handler = groupManager.getWorldsHolder().getWorldPermissions(worldName);
|
||||||
}
|
}
|
||||||
|
if (handler == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return handler.getGroup(playerName);
|
return handler.getGroup(playerName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -357,7 +363,14 @@ public class Permission_GroupManager extends Permission {
|
|||||||
public String[] getGroups() {
|
public String[] getGroups() {
|
||||||
Set<String> groupNames = new HashSet<String>();
|
Set<String> groupNames = new HashSet<String>();
|
||||||
for (World world : Bukkit.getServer().getWorlds()) {
|
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) {
|
for (Group group : groups) {
|
||||||
groupNames.add(group.getName());
|
groupNames.add(group.getName());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user