Residence zone null checks.

This commit is contained in:
MobiusDevelopment
2020-10-16 06:30:35 +00:00
parent b2ee30a67e
commit 729d7d9e3a
4 changed files with 16 additions and 6 deletions

View File

@@ -51,7 +51,10 @@ public class CastleZone extends ZoneRespawn
final int castleId = Integer.parseInt(value);
// Register self to the correct castle
_castle = CastleManager.getInstance().getCastleById(castleId);
_castle.setZone(this);
if (_castle != null)
{
_castle.setZone(this);
}
break;
}
default:

View File

@@ -47,10 +47,10 @@ public class ClanHallZone extends ZoneRespawn
{
_clanHallId = Integer.parseInt(value);
// Register self to the correct clan hall
final ClanHall ch = ClanHallManager.getInstance().getClanHallById(_clanHallId);
if (ch != null)
final ClanHall clanHall = ClanHallManager.getInstance().getClanHallById(_clanHallId);
if (clanHall != null)
{
ClanHallManager.getInstance().getClanHallById(_clanHallId).setZone(this);
clanHall.setZone(this);
}
break;
}