diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index e877536e81..4c882ac566 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -599,6 +599,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } public void hidePlayer(Player player) { + Validate.notNull(player, "hidden player cannot be null"); + if (equals(player)) return; if (hiddenPlayers.containsKey(player.getName())) return; hiddenPlayers.put(player.getName(), player); @@ -615,6 +617,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } public void showPlayer(Player player) { + Validate.notNull(player, "shown player cannot be null"); + if (equals(player)) return; if (!hiddenPlayers.containsKey(player.getName())) return; hiddenPlayers.remove(player.getName());