summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsr55 <[email protected]>2019-01-04 21:37:11 +0000
committersr55 <[email protected]>2019-01-04 21:37:11 +0000
commit92e8e81de2d5c5fe29e30d7d2004507a9811cba8 (patch)
tree1045f510dfa4db17751536475aec698459bc07b4
parentc9981d44669f19962691f985a0560682fc73b159 (diff)
WinGui: Fix a potential crash in the OptionsTabNameConverter. Fixes #1784
-rw-r--r--win/CS/HandBrakeWPF/Converters/Options/OptionsTabNameConverter.cs16
1 files changed, 12 insertions, 4 deletions
diff --git a/win/CS/HandBrakeWPF/Converters/Options/OptionsTabNameConverter.cs b/win/CS/HandBrakeWPF/Converters/Options/OptionsTabNameConverter.cs
index 5c0fb47f0..26919a351 100644
--- a/win/CS/HandBrakeWPF/Converters/Options/OptionsTabNameConverter.cs
+++ b/win/CS/HandBrakeWPF/Converters/Options/OptionsTabNameConverter.cs
@@ -13,8 +13,6 @@ namespace HandBrakeWPF.Converters.Options
using System.Globalization;
using System.Windows.Data;
- using HandBrake.Interop.Utilities;
-
using HandBrakeWPF.Model;
using HandBrakeWPF.Utilities;
@@ -43,7 +41,12 @@ namespace HandBrakeWPF.Converters.Options
/// </returns>
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
- return EnumHelper<OptionsTab>.GetDisplay((OptionsTab)value);
+ if (value != null)
+ {
+ return EnumHelper<OptionsTab>.GetDisplay((OptionsTab)value);
+ }
+
+ return null;
}
/// <summary>
@@ -66,7 +69,12 @@ namespace HandBrakeWPF.Converters.Options
/// </returns>
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
- return EnumHelper<OptionsTab>.GetValue(value.ToString());
+ if (value != null)
+ {
+ return EnumHelper<OptionsTab>.GetValue(value.ToString());
+ }
+
+ return null;
}
}
} \ No newline at end of file