Check that item in hand is not null after book event. Fixes BUKKIT-5443

By: Des Herriott <des.herriott@gmail.com>
This commit is contained in:
CraftBukkit/Spigot 2014-02-27 12:32:21 +00:00
parent 25c4255d7c
commit b76c55a802

View file

@ -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()) {