diff --git a/OpenRA.Mods.Common/Graphics/DefaultSpriteSequence.cs b/OpenRA.Mods.Common/Graphics/DefaultSpriteSequence.cs index fe02a3970c..021efda8dd 100644 --- a/OpenRA.Mods.Common/Graphics/DefaultSpriteSequence.cs +++ b/OpenRA.Mods.Common/Graphics/DefaultSpriteSequence.cs @@ -34,15 +34,22 @@ namespace OpenRA.Mods.Common.Graphics var nodes = node.Value.ToDictionary(); MiniYaml defaults; - if (nodes.TryGetValue("Defaults", out defaults)) + try { - nodes.Remove("Defaults"); - foreach (var n in nodes) + if (nodes.TryGetValue("Defaults", out defaults)) { - n.Value.Nodes = MiniYaml.Merge(new[] { defaults.Nodes, n.Value.Nodes }); - n.Value.Value = n.Value.Value ?? defaults.Value; + nodes.Remove("Defaults"); + foreach (var n in nodes) + { + n.Value.Nodes = MiniYaml.Merge(new[] { defaults.Nodes, n.Value.Nodes }); + n.Value.Value = n.Value.Value ?? defaults.Value; + } } } + catch (Exception e) + { + throw new Exception("Error occurred while parsing {0}".F(node.Key), e); + } foreach (var kvp in nodes) {