From b76c55a80208714a87f7d5d644820838ce69657b Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Thu, 27 Feb 2014 12:32:21 +0000 Subject: [PATCH] Check that item in hand is not null after book event. Fixes BUKKIT-5443 By: Des Herriott --- .../java/org/bukkit/craftbukkit/event/CraftEventFactory.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/paper-server/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java index 4cc25f2c5f..30f31d1fc4 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -709,7 +709,7 @@ public class CraftEventFactory { ItemStack itemInHand = player.inventory.getItem(itemInHandIndex); // If they've got the same item in their hand, it'll need to be updated. - if (itemInHand.getItem() == Items.BOOK_AND_QUILL) { + if (itemInHand != null && itemInHand.getItem() == Items.BOOK_AND_QUILL) { if (!editBookEvent.isCancelled()) { CraftItemStack.setItemMeta(itemInHand, editBookEvent.getNewBookMeta()); if (editBookEvent.isSigning()) {