From 542a0e08be3bfa084365d2a2d9882b0a30d651a8 Mon Sep 17 00:00:00 2001 From: James Groom Date: Tue, 24 Oct 2023 22:50:44 +1000 Subject: [PATCH] Fix `Process.Start` crash in Play Movie dialog on Linux --- src/BizHawk.Client.EmuHawk/movie/PlayMovie.cs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/BizHawk.Client.EmuHawk/movie/PlayMovie.cs b/src/BizHawk.Client.EmuHawk/movie/PlayMovie.cs index dbca1eee1d..08ea399b28 100644 --- a/src/BizHawk.Client.EmuHawk/movie/PlayMovie.cs +++ b/src/BizHawk.Client.EmuHawk/movie/PlayMovie.cs @@ -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() - .Select(index => _movieList[index])) + try { - System.Diagnostics.Process.Start(movie.Filename); + foreach (var movie in MovieView.SelectedIndices.Cast().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 } }