mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-26 19:18:29 +01:00
Fix NPE with /list in console
This commit is contained in:
parent
6269ce9a3f
commit
9b69403ee1
@ -51,7 +51,7 @@ public class PlayerList
|
|||||||
int hiddenCount = 0;
|
int hiddenCount = 0;
|
||||||
for (Player onlinePlayer : server.getOnlinePlayers())
|
for (Player onlinePlayer : server.getOnlinePlayers())
|
||||||
{
|
{
|
||||||
if (ess.getUser(onlinePlayer).isHidden(user.getBase()))
|
if (ess.getUser(onlinePlayer).isHidden() || (user != null && !user.getBase().canSee(onlinePlayer)))
|
||||||
{
|
{
|
||||||
playerHidden++;
|
playerHidden++;
|
||||||
if (showHidden || user.getBase().canSee(onlinePlayer))
|
if (showHidden || user.getBase().canSee(onlinePlayer))
|
||||||
@ -80,7 +80,8 @@ public class PlayerList
|
|||||||
for (Player onlinePlayer : server.getOnlinePlayers())
|
for (Player onlinePlayer : server.getOnlinePlayers())
|
||||||
{
|
{
|
||||||
final User onlineUser = ess.getUser(onlinePlayer);
|
final User onlineUser = ess.getUser(onlinePlayer);
|
||||||
if (onlineUser.isHidden(sender.getBase()) && !showHidden && (sender != null && !sender.getBase().canSee(onlinePlayer)))
|
if ((sender == null && !showHidden && onlineUser.isHidden()) ||
|
||||||
|
(sender != null && !showHidden && !sender.getBase().canSee(onlinePlayer)))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user