fix crash in engine for missing rules sections (music, etc)

This commit is contained in:
Chris Forbes
2010-05-08 21:39:33 +12:00
parent 08f5238be0
commit 6d4431411a
3 changed files with 35 additions and 22 deletions

View File

@@ -86,6 +86,9 @@ namespace OpenRA.FileFormats
ShellmapUid = yaml["ShellmapUid"].Value;
}
static string[] YamlList(Dictionary<string, MiniYaml> ys, string key) { return ys[key].Nodes.Keys.ToArray(); }
static string[] YamlList(Dictionary<string, MiniYaml> ys, string key)
{
return ys.ContainsKey(key) ? ys[key].Nodes.Keys.ToArray() : new string[] { };
}
}
}