Fixed a NPE in TerrainCheck pre shop creation

This commit is contained in:
Acrobot 2013-01-29 21:02:03 +01:00
parent 4ba69135cb
commit 616950e54a
1 changed files with 3 additions and 1 deletions

View File

@ -7,6 +7,7 @@ import com.Acrobot.ChestShop.Permission;
import com.Acrobot.ChestShop.Security;
import com.Acrobot.ChestShop.Signs.ChestShopSign;
import com.Acrobot.ChestShop.Utils.uBlock;
import org.bukkit.Location;
import org.bukkit.block.Chest;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
@ -41,8 +42,9 @@ public class TerrainChecker implements Listener {
}
Chest connectedChest = uBlock.findConnectedChest(event.getSign().getBlock());
Location chestLocation = (connectedChest != null ? connectedChest.getLocation() : null);
BuildPermissionEvent bEvent = new BuildPermissionEvent(player, connectedChest.getLocation(), event.getSign().getLocation());
BuildPermissionEvent bEvent = new BuildPermissionEvent(player, chestLocation, event.getSign().getLocation());
ChestShop.callEvent(bEvent);
if (!bEvent.isAllowed()) {