summaryrefslogtreecommitdiffstats
path: root/src/main/java/org
diff options
context:
space:
mode:
authorTravis Watkins <amaranth@ubuntu.com>2012-04-24 12:25:07 -0500
committerEvilSeph <evilseph@gmail.com>2012-04-24 21:57:54 -0400
commit9c12dc0ef8fa1310452d8f51f3e7194072e08df6 (patch)
treeec00042f1114fd24258a63cb0da0c45b165095aa /src/main/java/org
parent0220c1ff746cd721c14fa1b09836addc26742e14 (diff)
downloadcraftbukkit-9c12dc0ef8fa1310452d8f51f3e7194072e08df6.tar
craftbukkit-9c12dc0ef8fa1310452d8f51f3e7194072e08df6.tar.gz
craftbukkit-9c12dc0ef8fa1310452d8f51f3e7194072e08df6.tar.lz
craftbukkit-9c12dc0ef8fa1310452d8f51f3e7194072e08df6.tar.xz
craftbukkit-9c12dc0ef8fa1310452d8f51f3e7194072e08df6.zip
Fix potential NPE in vanish API. Fixes BUKKIT-1541
Diffstat (limited to 'src/main/java/org')
-rw-r--r--src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 1a605880..208e1622 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -596,6 +596,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
if (hiddenPlayers.containsKey(player.getName())) return;
hiddenPlayers.put(player.getName(), player);
+ if (getHandle().netServerHandler == null) {
+ return;
+ }
+
//remove this player from the hidden player's EntityTrackerEntry
EntityTracker tracker = ((WorldServer) entity.world).tracker;
EntityPlayer other = ((CraftPlayer) player).getHandle();
@@ -614,6 +618,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
if (!hiddenPlayers.containsKey(player.getName())) return;
hiddenPlayers.remove(player.getName());
+ if (getHandle().netServerHandler == null) {
+ return;
+ }
+
EntityTracker tracker = ((WorldServer) entity.world).tracker;
EntityPlayer other = ((CraftPlayer) player).getHandle();
EntityTrackerEntry entry = (EntityTrackerEntry) tracker.trackedEntities.get(other.id);