From 1c8c97e97a373602b238dff792e508e1a1a2bcde Mon Sep 17 00:00:00 2001 From: sr55 Date: Wed, 5 Jul 2017 19:35:28 +0100 Subject: WinGui: Make the Preset Import system a bit more robust. #808 --- win/CS/HandBrake.ApplicationServices/Interop/Json/Presets/HBPreset.cs | 2 +- win/CS/HandBrakeWPF/Services/Presets/PresetService.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Presets/HBPreset.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Presets/HBPreset.cs index 1df789cb2..118b5cbf7 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Presets/HBPreset.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Presets/HBPreset.cs @@ -311,7 +311,7 @@ namespace HandBrake.ApplicationServices.Interop.Json.Presets /// /// Gets or sets the video avg bitrate. /// - public int VideoAvgBitrate { get; set; } + public int? VideoAvgBitrate { get; set; } /// /// Gets or sets the video color matrix code. diff --git a/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs b/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs index b581becb2..14001040e 100644 --- a/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs +++ b/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs @@ -198,7 +198,7 @@ namespace HandBrakeWPF.Services.Presets foreach (var objectPreset in container.PresetList) { PresetCategory category = JsonConvert.DeserializeObject(objectPreset.ToString()); - if (category != null && category.ChildrenArray.Count > 0) + if (category != null && category.ChildrenArray != null && category.ChildrenArray.Count > 0) { foreach (HBPreset hbPreset in category.ChildrenArray) { -- cgit v1.2.3