Fix exception on load when starting with no arguments

This commit is contained in:
Timothy Baldridge 2019-11-17 15:32:33 -07:00
parent c9e15cf7db
commit 3e02500f4d

View File

@ -33,7 +33,7 @@ namespace Wabbajack
public static MainSettings LoadSettings()
{
string[] args = Environment.GetCommandLineArgs();
if (!File.Exists(Filename) || args[1] == "nosettings") return new MainSettings();
if (!File.Exists(Filename) || args.Length > 1 && args[1] == "nosettings") return new MainSettings();
return JsonConvert.DeserializeObject<MainSettings>(File.ReadAllText(Filename));
}