mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-02 13:07:06 +01:00
Fix potential NPE in vanish API. Fixes BUKKIT-1541
This commit is contained in:
parent
0220c1ff74
commit
9c12dc0ef8
1 changed files with 8 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue