diff options
author | sr55 <[email protected]> | 2017-01-12 21:21:33 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2017-01-12 21:21:59 +0000 |
commit | 776c45aa6526088e0f653f407687212e19efac43 (patch) | |
tree | 3f6803330210050b80701b16f2ff4aedb994264c /win/CS/HandBrake.ApplicationServices | |
parent | 47a5fb65254a943aff1cef2aa4278a9f72ce474a (diff) |
WinGui: Put up a clearer error when we can't read older presets rather than just showing a stack trace. #513
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices')
-rw-r--r-- | win/CS/HandBrake.ApplicationServices/Interop/HandBrakePresetService.cs | 9 |
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>
|