SPIGOT-1051: CraftInventoryPlayer.setItem can cause NPE.

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot 2015-07-18 12:43:33 +10:00
parent ba5443ae84
commit 06bf5fda59

View file

@ -37,6 +37,7 @@ public class CraftInventoryPlayer extends CraftInventory implements org.bukkit.i
@Override
public void setItem(int index, ItemStack item) {
super.setItem(index, item);
if (this.getHolder() == null) return;
EntityPlayer player = ((CraftPlayer) this.getHolder()).getHandle();
if (player.playerConnection == null) return;
// PacketPlayOutSetSlot places the items differently than setItem()