From 53ed0dad486b79e3dac1177b47a3456897de5b05 Mon Sep 17 00:00:00 2001 From: Travis Watkins Date: Wed, 25 Apr 2012 16:37:17 -0500 Subject: [PATCH] Don't call event if getOwner is null. Fixes BUKKIT-1545 --- .../net/minecraft/server/TileEntityBrewingStand.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/minecraft/server/TileEntityBrewingStand.java b/src/main/java/net/minecraft/server/TileEntityBrewingStand.java index abfa178bbe..f5c15f9250 100644 --- a/src/main/java/net/minecraft/server/TileEntityBrewingStand.java +++ b/src/main/java/net/minecraft/server/TileEntityBrewingStand.java @@ -127,9 +127,13 @@ public class TileEntityBrewingStand extends TileEntity implements IInventory { ItemStack itemstack = this.items[3]; // CraftBukkit start - fire BREW event - BrewEvent event = new BrewEvent(world.getWorld().getBlockAt(x, y, z), (BrewerInventory) this.getOwner().getInventory()); - Bukkit.getPluginManager().callEvent(event); - if(event.isCancelled()) return; + if (getOwner() != null) { + BrewEvent event = new BrewEvent(world.getWorld().getBlockAt(x, y, z), (BrewerInventory) this.getOwner().getInventory()); + Bukkit.getPluginManager().callEvent(event); + if(event.isCancelled()) { + return; + } + } // CraftBukkit end for (int i = 0; i < 3; ++i) {