summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
diff options
context:
space:
mode:
authorsr55 <[email protected]>2020-06-03 18:25:20 +0100
committersr55 <[email protected]>2020-06-03 18:25:30 +0100
commitcf8281966e0ff934b9c5728f82afe6ab08f61b28 (patch)
tree5fc2269f3cde96b21e52fbc7f91de890e57859c6 /win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
parent769b48378969aa7cd927873804ab0ad4cb79e06e (diff)
WinGui: Fix an issue where the treeview control can, when categories are closed, trigger a series of events that cause the preset to be de-selected.
Fix an issue where removing a preset can leave none selected. #2875
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs')
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs7
1 files changed, 6 insertions, 1 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
index 68fe8672f..f0b005625 100644
--- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
@@ -315,6 +315,11 @@ namespace HandBrakeWPF.ViewModels
{
if (!object.Equals(this.selectedPreset, value))
{
+ if (value == null)
+ {
+ this.errorService.ShowError("Null Preset", null, Environment.StackTrace.ToString());
+ }
+
if (value != null)
{
this.PresetSelect(value);
@@ -1732,7 +1737,7 @@ namespace HandBrakeWPF.ViewModels
this.presetService.Remove(this.selectedPreset);
this.NotifyOfPropertyChange(() => this.CategoryPresets);
- this.SelectedPreset = this.CategoryPresets.FirstOrDefault();
+ this.SelectedPreset = this.presetService.DefaultPreset;
}
else
{