From aec1e3a529be353c7036eda83e58871311c63b54 Mon Sep 17 00:00:00 2001 From: sk89q Date: Mon, 5 Nov 2012 11:09:14 -0800 Subject: [PATCH] Fixed NPE in PlayerInteractEvent due to potion blocking. Fixes WORLDGUARD-2269. --- .../com/sk89q/worldguard/bukkit/WorldGuardPlayerListener.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardPlayerListener.java b/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardPlayerListener.java index 1c27f4bc..7e3c1193 100644 --- a/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardPlayerListener.java +++ b/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardPlayerListener.java @@ -425,7 +425,7 @@ public void onPlayerInteract(PlayerInteractEvent event) { if (wcfg.blockPotions.size() > 0) { ItemStack item = event.getItem(); - if (item.getType() == Material.POTION) { + if (item != null && item.getType() == Material.POTION) { PotionEffect blockedEffect = null; Potion potion = Potion.fromItemStack(item);