mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-23 01:27:40 +01:00
Don't assume primary group is always present
Fixes a potential issue with PEX 2.0 (and 1.x) where users may not have a primary group. Closes #2901.
This commit is contained in:
parent
8a04c1e232
commit
1c4ce7b4bd
@ -46,23 +46,31 @@ public abstract class AbstractVaultHandler extends SuperpermsHandler {
|
||||
@Override
|
||||
public String getPrefix(final Player base) {
|
||||
String playerPrefix = chat.getPlayerPrefix(base);
|
||||
if (playerPrefix == null) {
|
||||
String playerGroup = perms.getPrimaryGroup(base);
|
||||
return chat.getGroupPrefix(base.getWorld().getName(), playerGroup);
|
||||
} else {
|
||||
if (playerPrefix != null) {
|
||||
return playerPrefix;
|
||||
}
|
||||
|
||||
String playerGroup = perms.getPrimaryGroup(base);
|
||||
if (playerGroup != null) {
|
||||
return chat.getGroupPrefix(base.getWorld().getName(), playerGroup);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSuffix(final Player base) {
|
||||
String playerSuffix = chat.getPlayerSuffix(base);
|
||||
if (playerSuffix == null) {
|
||||
String playerGroup = perms.getPrimaryGroup(base);
|
||||
return chat.getGroupSuffix(base.getWorld().getName(), playerGroup);
|
||||
} else {
|
||||
if (playerSuffix != null) {
|
||||
return playerSuffix;
|
||||
}
|
||||
|
||||
String playerGroup = perms.getPrimaryGroup(base);
|
||||
if (playerGroup != null) {
|
||||
return chat.getGroupSuffix(base.getWorld().getName(), playerGroup);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
boolean canLoad() {
|
||||
|
Loading…
Reference in New Issue
Block a user