Merge pull request #8315 from Mailaender/health-attacker-nre

Fixed a possible NRE in Health.InflictDamage debug logging
This commit is contained in:
Oliver Brakmann
2015-05-31 17:04:09 +02:00

View File

@@ -157,7 +157,10 @@ namespace OpenRA.Traits
if (RemoveOnDeath)
self.Destroy();
Log.Write("debug", "{0} #{1} killed by {2} #{3}", self.Info.Name, self.ActorID, attacker.Info.Name, attacker.ActorID);
if (attacker == null)
Log.Write("debug", "{0} #{1} was killed.", self.Info.Name, self.ActorID);
else
Log.Write("debug", "{0} #{1} killed by {2} #{3}", self.Info.Name, self.ActorID, attacker.Info.Name, attacker.ActorID);
}
}