From 2ca8e4b9afed3aa3b47e806cd89207b97b23acbe Mon Sep 17 00:00:00 2001 From: Brettflan Date: Wed, 9 Mar 2011 18:21:17 -0600 Subject: [PATCH] Fix for player right-clicking in the air causing an NPE due to target block being null --- .../mcteam/factions/listeners/FactionsPlayerListener.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/com/bukkit/mcteam/factions/listeners/FactionsPlayerListener.java b/src/com/bukkit/mcteam/factions/listeners/FactionsPlayerListener.java index 0efe2b66..b13ba8e9 100644 --- a/src/com/bukkit/mcteam/factions/listeners/FactionsPlayerListener.java +++ b/src/com/bukkit/mcteam/factions/listeners/FactionsPlayerListener.java @@ -153,6 +153,9 @@ public class FactionsPlayerListener extends PlayerListener{ if (event.isCancelled()) return; + if (event.getBlockClicked() == null) + return; // right-clicked on air, not a block; no worries then + if (!this.playerCanUseItemHere(event.getPlayer(), event.getBlockClicked(), event.getItem().getTypeId())) { event.setCancelled(true);