Residence zone null checks.
This commit is contained in:
@@ -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:
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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:
|
||||
|
@@ -47,7 +47,11 @@ public class ClanHallZone extends ZoneRespawn
|
||||
{
|
||||
_clanHallId = Integer.parseInt(value);
|
||||
// Register self to the correct clan hall
|
||||
ClanHallManager.getInstance().getClanHallById(_clanHallId).setZone(this);
|
||||
final ClanHall clanHall = ClanHallManager.getInstance().getClanHallById(_clanHallId);
|
||||
if (clanHall != null)
|
||||
{
|
||||
clanHall.setZone(this);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
Reference in New Issue
Block a user