From 49ff166d158d4810cb43996c724d167179b88e10 Mon Sep 17 00:00:00 2001 From: Kevin Ingersoll Date: Sat, 10 Mar 2012 14:58:20 -0800 Subject: [PATCH] Fixed potential packet loss issue with vanish API. Fixes BUKKIT-1125 --- src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java | 4 ++++ 1 file changed, 4 insertions(+) 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());