make selecting user shaders not crash with the default empty string path

Path.GetDirectoryName throws if it is handed an empty string apparently
This commit is contained in:
CasualPokePlayer 2022-12-17 12:13:14 -08:00
parent a680739c6e
commit 8d5f7b5478
1 changed files with 2 additions and 1 deletions

View File

@ -270,7 +270,8 @@ namespace BizHawk.Client.EmuHawk
{
var result = this.ShowFileOpenDialog(
filter: CgShaderPresetsFSFilterSet,
initDir: Path.GetDirectoryName(_pathSelection)!,
initDir: string.IsNullOrWhiteSpace(_pathSelection)
? string.Empty : Path.GetDirectoryName(_pathSelection)!,
initFileName: _pathSelection);
if (result is null) return;