Prevent loading 'null' style

This commit is contained in:
stefnotch
2020-12-30 10:28:17 +01:00
parent 8998eb2330
commit 96dbd3a937

View File

@@ -196,9 +196,9 @@ namespace FlaxEditor.Options
// If a non-default style was chosen, switch to that style
string styleName = themeOptions.SelectedStyle;
if (styleName != "Default" && themeOptions.Styles.ContainsKey(styleName))
if (styleName != "Default" && themeOptions.Styles.TryGetValue(styleName, out var style) && style != null)
{
Style.Current = themeOptions.Styles[themeOptions.SelectedStyle];
Style.Current = style;
}
else
{