fix a crash in the replay browser

This commit is contained in:
Chris Forbes
2010-12-19 17:46:11 +13:00
parent 2fad6f3bf1
commit f3d0e4b8ed
2 changed files with 16 additions and 8 deletions

View File

@@ -75,6 +75,8 @@ namespace OpenRA.Mods.RA.Widgets.Delegates
{
currentReplay = value;
if (currentReplay != null)
{
try
{
var summary = new ReplaySummary(currentReplay);
var mapStub = MapStubFromSummary(summary);
@@ -85,6 +87,12 @@ namespace OpenRA.Mods.RA.Widgets.Delegates
widget.GetWidget<LabelWidget>("MAP_TITLE").GetText =
() => mapStub != null ? mapStub.Title : "(Unknown Map)";
}
catch(Exception e)
{
Log.Write("debug", "Exception while parsing replay: {0}", e.ToString());
currentReplay = null;
}
}
}
}

View File

@@ -15,7 +15,7 @@ Background@REPLAYBROWSER_BG:
Text:Choose Replay
Align:Center
Bold:True
ListBox@REPLAY_LIST:
ScrollPanel@REPLAY_LIST:
Id:REPLAY_LIST
X:20
Y:50