From 9b69403ee1fd09ccab8fbc2b1331318a7b71b326 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Fri, 27 Jun 2014 03:48:26 +0100 Subject: [PATCH] Fix NPE with /list in console --- Essentials/src/com/earth2me/essentials/PlayerList.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/PlayerList.java b/Essentials/src/com/earth2me/essentials/PlayerList.java index bfd7ce2b1..f0ce2fb84 100644 --- a/Essentials/src/com/earth2me/essentials/PlayerList.java +++ b/Essentials/src/com/earth2me/essentials/PlayerList.java @@ -51,7 +51,7 @@ public class PlayerList int hiddenCount = 0; for (Player onlinePlayer : server.getOnlinePlayers()) { - if (ess.getUser(onlinePlayer).isHidden(user.getBase())) + if (ess.getUser(onlinePlayer).isHidden() || (user != null && !user.getBase().canSee(onlinePlayer))) { playerHidden++; if (showHidden || user.getBase().canSee(onlinePlayer)) @@ -80,7 +80,8 @@ public class PlayerList for (Player onlinePlayer : server.getOnlinePlayers()) { 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; }