mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-23 09:37:50 +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
|
@Override
|
||||||
public String getPrefix(final Player base) {
|
public String getPrefix(final Player base) {
|
||||||
String playerPrefix = chat.getPlayerPrefix(base);
|
String playerPrefix = chat.getPlayerPrefix(base);
|
||||||
if (playerPrefix == null) {
|
if (playerPrefix != null) {
|
||||||
String playerGroup = perms.getPrimaryGroup(base);
|
|
||||||
return chat.getGroupPrefix(base.getWorld().getName(), playerGroup);
|
|
||||||
} else {
|
|
||||||
return playerPrefix;
|
return playerPrefix;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String playerGroup = perms.getPrimaryGroup(base);
|
||||||
|
if (playerGroup != null) {
|
||||||
|
return chat.getGroupPrefix(base.getWorld().getName(), playerGroup);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSuffix(final Player base) {
|
public String getSuffix(final Player base) {
|
||||||
String playerSuffix = chat.getPlayerSuffix(base);
|
String playerSuffix = chat.getPlayerSuffix(base);
|
||||||
if (playerSuffix == null) {
|
if (playerSuffix != null) {
|
||||||
String playerGroup = perms.getPrimaryGroup(base);
|
|
||||||
return chat.getGroupSuffix(base.getWorld().getName(), playerGroup);
|
|
||||||
} else {
|
|
||||||
return playerSuffix;
|
return playerSuffix;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String playerGroup = perms.getPrimaryGroup(base);
|
||||||
|
if (playerGroup != null) {
|
||||||
|
return chat.getGroupSuffix(base.getWorld().getName(), playerGroup);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean canLoad() {
|
boolean canLoad() {
|
||||||
|
Loading…
Reference in New Issue
Block a user