From 500da075654682ff7aca2ebcc2cb608d1d2e119b Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sat, 18 Feb 2017 11:27:26 +0000 Subject: [PATCH] Fix mod switching failing when launchArgs is null. --- OpenRA.Game/Game.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/OpenRA.Game/Game.cs b/OpenRA.Game/Game.cs index a7be84ea6c..48e6908ea8 100644 --- a/OpenRA.Game/Game.cs +++ b/OpenRA.Game/Game.cs @@ -470,10 +470,8 @@ namespace OpenRA { try { - var argsString = mod.LaunchArgs.Append(launchArguments) - .Select(a => "\"" + a + "\"").JoinWith(" "); - - var p = Process.Start(mod.LaunchPath, argsString); + var args = launchArguments != null ? mod.LaunchArgs.Append(launchArguments) : mod.LaunchArgs; + var p = Process.Start(mod.LaunchPath, args.Select(a => "\"" + a + "\"").JoinWith(" ")); if (p == null || p.HasExited) onFailed(); else @@ -482,8 +480,10 @@ namespace OpenRA Exit(); } } - catch + catch (Exception e) { + Log.Write("debug", "Failed to switch to external mod."); + Log.Write("debug", "Error was: " + e.Message); onFailed(); } }