fix a rare NullReferenceException in CanUnload

closes #5528
This commit is contained in:
Matthias Mailänder
2014-06-02 10:18:09 +02:00
parent 4f79ce0459
commit e66358792e

View File

@@ -108,7 +108,7 @@ namespace OpenRA.Mods.RA
bool CanUnload() bool CanUnload()
{ {
return !IsEmpty(self) && self.CenterPosition.Z == 0 return !IsEmpty(self) && self.CenterPosition.Z == 0
&& CurrentAdjacentCells.Any(c => Passengers.Any(p => p.Trait<IPositionable>().CanEnterCell(c))); && CurrentAdjacentCells != null && CurrentAdjacentCells.Any(c => Passengers.Any(p => p.Trait<IPositionable>().CanEnterCell(c)));
} }
public bool CanLoad(Actor self, Actor a) public bool CanLoad(Actor self, Actor a)