fixed null pointer exception when interacting with a block when your clan home is null
This commit is contained in:
parent
6ca4d12d98
commit
9bae314278
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user