From 04cef3cb209a99450e69238176ddb72e20162780 Mon Sep 17 00:00:00 2001 From: Erwin Yulianto Date: Wed, 8 Feb 2023 06:44:58 +0700 Subject: [PATCH] Fix #5533 - Null checker on EditorHostSetting --- .../DNNConnect.CKE/Utilities/SettingsUtil.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DNN Platform/Providers/HtmlEditorProviders/DNNConnect.CKE/Utilities/SettingsUtil.cs b/DNN Platform/Providers/HtmlEditorProviders/DNNConnect.CKE/Utilities/SettingsUtil.cs index 7e43bff37be..d22041be3be 100644 --- a/DNN Platform/Providers/HtmlEditorProviders/DNNConnect.CKE/Utilities/SettingsUtil.cs +++ b/DNN Platform/Providers/HtmlEditorProviders/DNNConnect.CKE/Utilities/SettingsUtil.cs @@ -176,7 +176,7 @@ internal static EditorProviderSettings LoadEditorSettingsByKey( typeof(CodeMirror).GetProperties() .Where(codeMirrorInfo => !codeMirrorInfo.Name.Equals("Theme"))) { - settingValue = filteredSettings.FirstOrDefault(setting => setting.Name.Equals(string.Format("{0}{1}", key, codeMirrorInfo.Name))).Value; + settingValue = filteredSettings.FirstOrDefault(setting => setting.Name.Equals(string.Format("{0}{1}", key, codeMirrorInfo.Name)))?.Value; switch (codeMirrorInfo.PropertyType.Name) { case "String": @@ -207,7 +207,7 @@ internal static EditorProviderSettings LoadEditorSettingsByKey( case "WordCount": foreach (var wordCountInfo in typeof(WordCountConfig).GetProperties()) { - settingValue = filteredSettings.FirstOrDefault(setting => setting.Name.Equals(string.Format("{0}{1}", key, wordCountInfo.Name))).Value; + settingValue = filteredSettings.FirstOrDefault(setting => setting.Name.Equals(string.Format("{0}{1}", key, wordCountInfo.Name)))?.Value; switch (wordCountInfo.PropertyType.Name) { case "String":