From 30edee01c2d7a0bf66105086a613422d030db058 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Wed, 2 Jul 2014 12:18:47 +0200 Subject: [PATCH] check if palette.CurrentQueue is null to avoid a crash fixes #5624 --- OpenRA.Mods.Cnc/Widgets/Logic/ProductionTooltipLogic.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenRA.Mods.Cnc/Widgets/Logic/ProductionTooltipLogic.cs b/OpenRA.Mods.Cnc/Widgets/Logic/ProductionTooltipLogic.cs index 5866e6a71b..fc430a883e 100644 --- a/OpenRA.Mods.Cnc/Widgets/Logic/ProductionTooltipLogic.cs +++ b/OpenRA.Mods.Cnc/Widgets/Logic/ProductionTooltipLogic.cs @@ -66,7 +66,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic powerLabel.IsVisible = () => power != 0; var lowpower = pm.PowerState != PowerState.Normal; - var time = palette.CurrentQueue.GetBuildTime(actor) + var time = palette.CurrentQueue == null ? 0 : palette.CurrentQueue.GetBuildTime(actor) * (lowpower ? palette.CurrentQueue.Info.LowPowerSlowdown : 1); var timeString = "T: {0}".F(WidgetUtils.FormatTime(time)); timeLabel.GetText = () => timeString;