summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsr55 <[email protected]>2017-07-05 19:35:28 +0100
committersr55 <[email protected]>2017-07-05 19:35:56 +0100
commit1c8c97e97a373602b238dff792e508e1a1a2bcde (patch)
treef61b816bf4111e5c42bb6e9f3973d4959a6eef94
parent9148528a2a2d8c944ecc7a589b059a45418244d1 (diff)
WinGui: Make the Preset Import system a bit more robust. #808
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Json/Presets/HBPreset.cs2
-rw-r--r--win/CS/HandBrakeWPF/Services/Presets/PresetService.cs2
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
/// <summary>
/// Gets or sets the video avg bitrate.
/// </summary>
- public int VideoAvgBitrate { get; set; }
+ public int? VideoAvgBitrate { get; set; }
/// <summary>
/// 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<PresetCategory>(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)
{