From e556b707c910e30407a9433bf112b08a3fcd0a3e Mon Sep 17 00:00:00 2001 From: GJ Date: Fri, 22 Feb 2013 13:59:07 -0500 Subject: [PATCH] Fix for NPE when right/left clicking air. --- .../java/com/gmail/nossr50/listeners/PlayerListener.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java index e20cafb3a..ec26f221f 100644 --- a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java @@ -327,7 +327,12 @@ public class PlayerListener implements Listener { } Block block = event.getClickedBlock(); - BlockState blockState = block.getState(); + BlockState blockState = null; + + if (block != null) { + blockState = block.getState(); + } + ItemStack heldItem = player.getItemInHand(); switch (event.getAction()) {