fixed null pointer exception when interacting with a block when your clan home is null

This commit is contained in:
NewGarbo 2015-11-23 17:19:00 +00:00
parent 6ca4d12d98
commit 9bae314278

View File

@ -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;
}