[skip ci] GSDumpgui: Handle dumpPath as optional. (#2981)

GsDump file can be optional in case you just want to launch the plugin config dialog.
Throw with a meaningful error message in case validation layer fails.
This commit is contained in:
willkuer 2019-06-06 04:21:02 +02:00 committed by lightningterror
parent cd11ae1ac6
commit a3bf46ecd9
1 changed files with 4 additions and 1 deletions

View File

@ -263,8 +263,11 @@ namespace GSDumpGUI
}
var port = Program.Server.Port;
// dll path is mandatory for the two operations GSReplay and GSconfigure but dumpPath only for GSReplay
var dllPath = _availableGsDlls.Selected.File.FullName;
var dumpPath = _availableGsDumps.Selected.File.FullName;
var dumpPath = _availableGsDumps.Selected?.File?.FullName;
if (string.IsNullOrWhiteSpace(dumpPath) && "GSReplay".Equals(Function))
throw new ArgumentException("You need to specify a dump path in case you want to replay a GsDump.", nameof(dumpPath));
_gsdxLogger.Information("Start new gsdx instance");
_gsdxLogger.Information($"\tdll: {dllPath}");