From 9bae31427874deac50ce340dfe3141568cdbd0af Mon Sep 17 00:00:00 2001 From: NewGarbo Date: Mon, 23 Nov 2015 17:19:00 +0000 Subject: [PATCH] fixed null pointer exception when interacting with a block when your clan home is null --- .../src/mineplex/game/clans/clans/ClansGame.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansGame.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansGame.java index 32c64f701..11f362f65 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansGame.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansGame.java @@ -383,7 +383,7 @@ public class ClansGame extends MiniPlugin } // Allow Clan's Home - if (event.getClickedBlock().getLocation().distance(home) <= 2 && event.getClickedBlock().getType().equals(Material.BED_BLOCK)) + if (home != null && event.getClickedBlock().getLocation().distance(home) <= 2 && event.getClickedBlock().getType().equals(Material.BED_BLOCK)) { return; } @@ -402,7 +402,7 @@ public class ClansGame extends MiniPlugin Location home = event.getClickedBlock() == null ? null : _clans.getClanUtility().getClanByClanName(_clans.getClanUtility().getClaim(event.getClickedBlock().getLocation()).Owner).getHome(); // Allow Clan's Home - if (event.getClickedBlock().getLocation().distance(home) <= 2 && event.getClickedBlock().getType().equals(Material.BED_BLOCK)) + if (home != null && event.getClickedBlock().getLocation().distance(home) <= 2 && event.getClickedBlock().getType().equals(Material.BED_BLOCK)) { return; }