From f475b0fbbdbf39ee1c6271ea19482a64d51bbbda Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Sat, 16 Jan 2010 14:33:28 +1300 Subject: [PATCH] fix crash when sending HELI to FIX --- OpenRa.Game/Traits/Helicopter.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenRa.Game/Traits/Helicopter.cs b/OpenRa.Game/Traits/Helicopter.cs index 34731a21c7..87f2f28a03 100644 --- a/OpenRa.Game/Traits/Helicopter.cs +++ b/OpenRa.Game/Traits/Helicopter.cs @@ -60,8 +60,8 @@ namespace OpenRa.Game.Traits if (res != null) reservation = res.Reserve(self); - var productionInfo = order.TargetActor.Info.Traits.Get(); - var offset = productionInfo.SpawnOffset; + var productionInfo = order.TargetActor.Info.Traits.GetOrDefault(); + var offset = productionInfo != null ? productionInfo.SpawnOffset : null; var offsetVec = offset != null ? new float2(offset[0], offset[1]) : float2.Zero; self.CancelActivity();