Fix `Process.Start` crash in Play Movie dialog on Linux

This commit is contained in:
James Groom 2023-10-24 22:50:44 +10:00 committed by GitHub
parent c7f438c240
commit 542a0e08be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 3 deletions

View File

@ -1,6 +1,8 @@
using System;
using System.Threading.Tasks;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Globalization;
using System.IO;
@ -457,10 +459,17 @@ namespace BizHawk.Client.EmuHawk
private void EditMenuItem_Click(object sender, EventArgs e)
{
foreach (var movie in MovieView.SelectedIndices.Cast<int>()
.Select(index => _movieList[index]))
try
{
System.Diagnostics.Process.Start(movie.Filename);
foreach (var movie in MovieView.SelectedIndices.Cast<int>().Select(index => _movieList[index]))
{
Process.Start(movie.Filename);
}
}
catch (Win32Exception ex) // "Access denied" when cancelling "Open With" dialog on Linux
{
Console.WriteLine(ex);
// and stop trying to open files
}
}