fix for rare case where faction home location's world being removed or renamed (world with specified name not existing) could lead to NPE

This commit is contained in:
Brettflan 2012-05-08 14:25:18 -05:00
parent 66a7685bf7
commit ba16a202ba

View File

@ -108,7 +108,7 @@ public class Faction extends Entity implements EconomyParticipator
} }
public void confirmValidHome() public void confirmValidHome()
{ {
if (!Conf.homesMustBeInClaimedTerritory || this.home == null || Board.getFactionAt(new FLocation(this.home.getLocation())) == this) if (!Conf.homesMustBeInClaimedTerritory || this.home == null || (this.home.getLocation() != null && Board.getFactionAt(new FLocation(this.home.getLocation())) == this))
return; return;
msg("<b>Your faction home has been un-set since it is no longer in your territory."); msg("<b>Your faction home has been un-set since it is no longer in your territory.");