summaryrefslogtreecommitdiffstats
path: root/src/main/java/org
diff options
context:
space:
mode:
authorDes Herriott <des.herriott@gmail.com>2014-02-27 12:32:21 +0000
committerTravis Watkins <amaranth@ubuntu.com>2014-04-18 12:30:53 -0500
commit8a6ed3a88b8cd8c08320157b605a63f56e9c4c88 (patch)
treeba413e7dab436c6144944dc4fe9d05177d6f59ef /src/main/java/org
parenta86bc7aeb394df65521555f1b73357c68503cbc5 (diff)
downloadcraftbukkit-8a6ed3a88b8cd8c08320157b605a63f56e9c4c88.tar
craftbukkit-8a6ed3a88b8cd8c08320157b605a63f56e9c4c88.tar.gz
craftbukkit-8a6ed3a88b8cd8c08320157b605a63f56e9c4c88.tar.lz
craftbukkit-8a6ed3a88b8cd8c08320157b605a63f56e9c4c88.tar.xz
craftbukkit-8a6ed3a88b8cd8c08320157b605a63f56e9c4c88.zip
Check that item in hand is not null after book event. Fixes BUKKIT-5443
Diffstat (limited to 'src/main/java/org')
-rw-r--r--src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 4cc25f2c..30f31d1f 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/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()) {