Added null check for probe in SectorAction.OnDestroy()

Absence of check led to unhandled VM abort exception in case of saved game failed to load
This commit is contained in:
alexey.lysiuk 2017-12-10 14:35:30 +02:00
parent a89bc23789
commit acc943329b

View file

@ -37,13 +37,16 @@ class SectorAction : Actor
else
{
Actor probe = CurSector.SecActTarget;
while (probe.tracer != self && probe.tracer != null)
if (null != probe)
{
probe = probe.tracer;
}
if (probe.tracer == self)
{
probe.tracer = tracer;
while (probe.tracer != self && probe.tracer != null)
{
probe = probe.tracer;
}
if (probe.tracer == self)
{
probe.tracer = tracer;
}
}
}
}