Fix a NRE in the exception handler.

This commit is contained in:
Paul Chote
2013-11-09 15:24:58 +13:00
parent 20f88387b6
commit 6aee253c94
2 changed files with 15 additions and 3 deletions

View File

@@ -46,8 +46,13 @@ namespace OpenRA
static void FatalError(Exception e)
{
Log.AddChannel("exception", "exception.log");
var mod = Game.CurrentMods.First().Value;
Log.Write("exception", "{0} Mod at Version {1}", mod.Title, mod.Version);
if (Game.CurrentMods != null)
{
var mod = Game.CurrentMods.First().Value;
Log.Write("exception", "{0} Mod at Version {1}", mod.Title, mod.Version);
}
Log.Write("exception", "Operating System: {0} ({1})", Platform.CurrentPlatform, Environment.OSVersion);
Log.Write("exception", "Runtime Version: {0}", Platform.RuntimeVersion);
var rpt = BuildExceptionReport(e).ToString();