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