mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-24 17:22:55 +01:00
SPIGOT-1051: CraftInventoryPlayer.setItem can cause NPE.
By: md_5 <git@md-5.net>
This commit is contained in:
parent
ba5443ae84
commit
06bf5fda59
1 changed files with 1 additions and 0 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Reference in a new issue