Fix UpgradeChromeMetrics.

This needs to handle the null value passed in for the parent parameter from it's only (non-recursive) callsite.
This commit is contained in:
RoosterDragon
2015-12-30 04:48:38 +00:00
parent 68fd5dfd58
commit a010b06b49

View File

@@ -3410,13 +3410,15 @@ namespace OpenRA.Mods.Common.UtilityCommands
internal static void UpgradeChromeLayout(int engineVersion, ref List<MiniYamlNode> 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);