diff options
author | sr55 <[email protected]> | 2020-06-03 18:25:20 +0100 |
---|---|---|
committer | sr55 <[email protected]> | 2020-06-03 18:25:30 +0100 |
commit | cf8281966e0ff934b9c5728f82afe6ab08f61b28 (patch) | |
tree | 5fc2269f3cde96b21e52fbc7f91de890e57859c6 /win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | |
parent | 769b48378969aa7cd927873804ab0ad4cb79e06e (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.cs | 7 |
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
{
|