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 12:47:46 -05:00
parent 1459c9c057
commit c32736f3f1

View File

@ -75,7 +75,7 @@ public class Faction extends Entity implements EconomyParticipator
}
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;
msg("<b>Your faction home has been un-set since it is no longer in your territory.");