From a010b06b49980c1749ceb25178bcff4fb123b2c4 Mon Sep 17 00:00:00 2001 From: RoosterDragon Date: Wed, 30 Dec 2015 04:48:38 +0000 Subject: [PATCH] Fix UpgradeChromeMetrics. This needs to handle the null value passed in for the parent parameter from it's only (non-recursive) callsite. --- OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs index e7ccf570e3..0e49de27fd 100644 --- a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs +++ b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs @@ -3410,13 +3410,15 @@ namespace OpenRA.Mods.Common.UtilityCommands internal static void UpgradeChromeLayout(int engineVersion, ref List nodes, MiniYamlNode parent, int depth) { + var parentKey = parent != null ? parent.Key.Split('@').First() : null; + foreach (var node in nodes) { if (engineVersion < 20151102) { if (node.Key == "Color" || node.Key == "ReadyTextAltColor" || node.Key == "TextColor" || node.Key == "TextColorDisabled") { - if (parent.Key.StartsWith("MapPreview@")) + if (parentKey == "MapPreview") TryUpdateHSLColor(ref node.Value.Value); else TryUpdateColor(ref node.Value.Value);