Make the legacy editor more robust against invalid templates.

This commit is contained in:
Paul Chote
2014-10-23 10:26:36 +13:00
parent 2b0042ca23
commit fda25a56ca
3 changed files with 12 additions and 2 deletions

View File

@@ -104,7 +104,14 @@ namespace OpenRA.Editor
public byte[][] Data(ushort id)
{
return templates[id];
byte[][] template;
if (!templates.TryGetValue(id, out template))
{
Console.WriteLine("warning: Unknown tile template {0}", id);
return null;
}
return template;
}
}
}