fix NPE in IPlayerManager#getOnlyVisibleFor(...)
This commit is contained in:
parent
db27f9e15f
commit
b2c2d98dd1
@ -115,12 +115,13 @@ public abstract class IPlayerManager<OP extends IOnlinePlayer, OF extends IOffPl
|
||||
|
||||
public List<OP> getOnlyVisibleFor(OF viewer) {
|
||||
List<OP> players = getAll();
|
||||
if (viewer != null)
|
||||
players.removeIf(op -> op.isVanishedFor(viewer));
|
||||
return players;
|
||||
}
|
||||
|
||||
public List<OP> getOnlyVisibleFor(OP viewer, boolean sameServerOnly) {
|
||||
if (sameServerOnly && viewer.getServerName() == null)
|
||||
if (sameServerOnly && (viewer == null || viewer.getServerName() == null))
|
||||
return Collections.emptyList();
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
|
Loading…
Reference in New Issue
Block a user