Fix potential NRE in AI BaseBuilder

Detected by Coverity
This commit is contained in:
Oliver Brakmann
2015-07-29 14:53:15 +02:00
parent 0ba54b425e
commit 1b9367ae4b

View File

@@ -135,7 +135,7 @@ namespace OpenRA.Mods.Common.AI
HackyAI.BotDebug("AI: {0} is starting production of {1}".F(player, item.Name)); HackyAI.BotDebug("AI: {0} is starting production of {1}".F(player, item.Name));
ai.QueueOrder(Order.StartProduction(queue.Actor, item.Name, 1)); ai.QueueOrder(Order.StartProduction(queue.Actor, item.Name, 1));
} }
else if (currentBuilding.Done) else if (currentBuilding != null && currentBuilding.Done)
{ {
// Production is complete // Production is complete
// Choose the placement logic // Choose the placement logic