Fixed a crash when adding opening the dialog to add a directory resource on Mono Winforms

This commit is contained in:
samwiddowson 2024-07-09 18:47:24 +01:00 committed by GitHub
parent e1ce00aa84
commit 349a6b0953
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -283,6 +283,7 @@ namespace CodeImp.DoomBuilder.Controls
{
bool flag = false;
#if !MONO_WINFORMS
if (Environment.OSVersion.Version.Major >= 6)
{
var r = new Reflector("System.Windows.Forms");
@ -313,6 +314,7 @@ namespace CodeImp.DoomBuilder.Controls
}
else
{
#endif
var fbd = new FolderBrowserDialog();
fbd.Description = this.Title;
fbd.SelectedPath = this.InitialDirectory;
@ -320,7 +322,9 @@ namespace CodeImp.DoomBuilder.Controls
if (fbd.ShowDialog(new WindowWrapper(hWndOwner)) != DialogResult.OK) return false;
ofd.FileName = fbd.SelectedPath;
flag = true;
#if !MONO_WINFORMS
}
#endif
return flag;
}