summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrake.ApplicationServices
diff options
context:
space:
mode:
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices')
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/HandBrakePresetService.cs9
1 files changed, 6 insertions, 3 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakePresetService.cs b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakePresetService.cs
index 7e1f95d3e..38ebb3515 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakePresetService.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakePresetService.cs
@@ -62,12 +62,15 @@ namespace HandBrake.ApplicationServices.Interop
{
IntPtr presetStringPointer = HBFunctions.hb_presets_read_file_json(InteropUtilities.ToUtf8PtrFromString(filename));
string presetJson = Marshal.PtrToStringAnsi(presetStringPointer);
-
log.LogMessage(presetJson, LogMessageType.API, LogLevel.Debug);
- PresetTransportContainer preset = JsonConvert.DeserializeObject<PresetTransportContainer>(presetJson);
+ if (!string.IsNullOrEmpty(presetJson))
+ {
+ PresetTransportContainer preset = JsonConvert.DeserializeObject<PresetTransportContainer>(presetJson);
+ return preset;
+ }
- return preset;
+ return null;
}
/// <summary>