From 96dbd3a937589c41a280b819083f894c275f788d Mon Sep 17 00:00:00 2001 From: stefnotch Date: Wed, 30 Dec 2020 10:28:17 +0100 Subject: [PATCH] Prevent loading 'null' style --- Source/Editor/Options/OptionsModule.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Editor/Options/OptionsModule.cs b/Source/Editor/Options/OptionsModule.cs index 16dae5e8d..dc8f49df5 100644 --- a/Source/Editor/Options/OptionsModule.cs +++ b/Source/Editor/Options/OptionsModule.cs @@ -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 {