From a4e2f796c7caba7367f41288c0ecd31bd7eda568 Mon Sep 17 00:00:00 2001 From: sr55 Date: Sat, 14 Jan 2017 19:16:46 +0000 Subject: [PATCH] WinGui: Fix a crash when saving presets for video encoders that don't have preset or profile options. #516 --- .../Services/Presets/Factories/JsonPresetFactory.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs b/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs index 4a2c973c6..c31495537 100644 --- a/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs +++ b/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs @@ -622,10 +622,10 @@ namespace HandBrakeWPF.Services.Presets.Factories preset.VideoFramerate = export.Task.Framerate.ToString(); preset.VideoFramerateMode = EnumHelper.GetShortName(export.Task.FramerateMode); preset.VideoGrayScale = export.Task.Grayscale; - preset.VideoLevel = export.Task.VideoLevel.ShortName; + preset.VideoLevel = export.Task.VideoLevel != null ? export.Task.VideoLevel.ShortName : null; preset.VideoOptionExtra = export.Task.ExtraAdvancedArguments; - preset.VideoPreset = export.Task.VideoPreset.ShortName; - preset.VideoProfile = export.Task.VideoProfile.ShortName; + preset.VideoPreset = export.Task.VideoPreset != null ? export.Task.VideoPreset.ShortName : null; + preset.VideoProfile = export.Task.VideoProfile != null ? export.Task.VideoProfile.ShortName : null; preset.VideoQSVAsyncDepth = 4; // Defaulted to 4 for now. preset.VideoQSVDecode = !config.DisableQuickSyncDecoding; preset.VideoQualitySlider = export.Task.Quality.HasValue ? export.Task.Quality.Value : 0; -- 2.40.0