Ensure main station exists before checking its properties

This commit is contained in:
cim 2015-03-16 18:13:36 +00:00
parent e77882ac51
commit eeaf83c14a

View File

@ -1364,7 +1364,7 @@ PriorityAIController.prototype.stationAllegiance = function(station)
}
}
}
if (allegiance == "neutral" && system.mainStation.position.distanceTo(station) < 51200)
if (allegiance == "neutral" && system.mainStation && system.mainStation.position.distanceTo(station) < 51200)
{
allegiance = "galcop"; // neutral stations in aegis
}