From faaf1ea1e1e154f7b857b74e07987605c68b15d2 Mon Sep 17 00:00:00 2001 From: RoosterDragon Date: Thu, 10 Sep 2015 19:45:07 +0100 Subject: [PATCH] Provide an early exit in RunActivity when there is no activity. --- OpenRA.Game/Traits/Util.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OpenRA.Game/Traits/Util.cs b/OpenRA.Game/Traits/Util.cs index 80a9b506f5..3ac2693589 100644 --- a/OpenRA.Game/Traits/Util.cs +++ b/OpenRA.Game/Traits/Util.cs @@ -74,6 +74,9 @@ namespace OpenRA.Traits public static Activity RunActivity(Actor self, Activity act) { + if (act == null) + return act; + // Note - manual iteration here for performance due to high call volume. var longTickThresholdInStopwatchTicks = PerfTimer.LongTickThresholdInStopwatchTicks; var start = Stopwatch.GetTimestamp();