diff options
author | KHobbits <rob@khobbits.co.uk> | 2014-06-27 03:48:26 +0100 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2014-06-27 04:28:33 +0100 |
commit | 19ace492c5f5c3bce8ee4c587a5596f45c736c30 (patch) | |
tree | 35747d331d187809a799b538408325a81ace6e37 | |
parent | 66ab0352ab0b3991da87468a97ed396c1f4be52b (diff) | |
download | Essentials-19ace492c5f5c3bce8ee4c587a5596f45c736c30.tar Essentials-19ace492c5f5c3bce8ee4c587a5596f45c736c30.tar.gz Essentials-19ace492c5f5c3bce8ee4c587a5596f45c736c30.tar.lz Essentials-19ace492c5f5c3bce8ee4c587a5596f45c736c30.tar.xz Essentials-19ace492c5f5c3bce8ee4c587a5596f45c736c30.zip |
Fix NPE with /list in console
-rw-r--r-- | Essentials/src/com/earth2me/essentials/PlayerList.java | 5 |
1 files 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; } |