From 4f9d9d29ef46b989a2d796b1821576ad7ccecd4c Mon Sep 17 00:00:00 2001 From: YoshiRulz Date: Thu, 2 Jul 2020 10:04:33 +1000 Subject: [PATCH] Fix NRE on clicking RecordMovie's browse button (fixes #2185) --- src/BizHawk.Client.EmuHawk/movie/RecordMovie.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/BizHawk.Client.EmuHawk/movie/RecordMovie.cs b/src/BizHawk.Client.EmuHawk/movie/RecordMovie.cs index 474f89b5da..22b83295ef 100644 --- a/src/BizHawk.Client.EmuHawk/movie/RecordMovie.cs +++ b/src/BizHawk.Client.EmuHawk/movie/RecordMovie.cs @@ -184,13 +184,14 @@ namespace BizHawk.Client.EmuHawk else throw; } + var preferredExt = _movieSession.Movie?.PreferredExtension ?? "bk2"; using var sfd = new SaveFileDialog { InitialDirectory = movieFolderPath, - DefaultExt = $".{_movieSession.Movie.PreferredExtension}", + DefaultExt = $".{preferredExt}", FileName = RecordBox.Text, OverwritePrompt = false, - Filter = new FilesystemFilterSet(new FilesystemFilter("Movie Files", new[] { _movieSession.Movie.PreferredExtension })).ToString() + Filter = new FilesystemFilterSet(new FilesystemFilter("Movie Files", new[] { preferredExt })).ToString() }; var result = sfd.ShowHawkDialog();