From 79f55a02cba42df7188e4d0a1d0cb9b7e4c7cb35 Mon Sep 17 00:00:00 2001 From: sk89q Date: Sat, 8 Jan 2011 18:38:18 -0800 Subject: [PATCH] Fixed NullPointerExceptions in item use hook. --- src/WorldGuardListener.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/WorldGuardListener.java b/src/WorldGuardListener.java index 420e9298..4f9e0b0f 100644 --- a/src/WorldGuardListener.java +++ b/src/WorldGuardListener.java @@ -960,7 +960,7 @@ public boolean onInventoryChange(Player player) { @Override public boolean onItemUse(Player player, Block blockPlaced, Block blockClicked, Item item) { - if (blacklist != null) { + if (blacklist != null && item != null) { int itemId = item.getItemId(); if (!blacklist.onUse(itemId, player)) { @@ -968,7 +968,7 @@ public boolean onItemUse(Player player, Block blockPlaced, } } - if (useRegions) { + if (useRegions && blockPlaced != null) { Vector pt = new Vector(blockPlaced.getX(), blockPlaced.getY(), blockPlaced.getZ()); LocalPlayer localPlayer = new HMPlayer(player);