Catch and ignore exceptions while loading map previews.

This commit is contained in:
Paul Chote
2017-05-26 21:15:40 +01:00
committed by reaperrr
parent 1f93029e51
commit b1ac1d06e3

View File

@@ -201,7 +201,19 @@ namespace OpenRA
foreach (var p in todo)
{
if (p.Preview != null)
Game.RunAfterTick(() => p.SetMinimap(sheetBuilder.Add(p.Preview)));
{
Game.RunAfterTick(() =>
{
try
{
p.SetMinimap(sheetBuilder.Add(p.Preview));
}
catch (Exception e)
{
Log.Write("debug", "Failed to load minimap with exception: {0}", e);
}
});
}
// Yuck... But this helps the UI Jank when opening the map selector significantly.
Thread.Sleep(Environment.ProcessorCount == 1 ? 25 : 5);