From a6b47bc1a8949c769a82e09ffb890c9582fb567b Mon Sep 17 00:00:00 2001 From: aldrashan Date: Wed, 26 Jun 2019 08:04:57 +0200 Subject: [PATCH] Fixes NullReferenceException thrown Fixes NullReferenceException thrown when ExpressionBuilder.Helpers.OperationHelper.GetCustomSupportedTypes is called and the ExpressionBuilder configuration section wasn't found. --- ExpressionBuilder/Configuration/Settings.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ExpressionBuilder/Configuration/Settings.cs b/ExpressionBuilder/Configuration/Settings.cs index 46a2612..bb08ca2 100644 --- a/ExpressionBuilder/Configuration/Settings.cs +++ b/ExpressionBuilder/Configuration/Settings.cs @@ -35,13 +35,13 @@ public static void LoadSettings(Settings settings) } } #else + settings.SupportedTypes = new List(); var configSection = ConfigurationManager.GetSection(ExpressionBuilderConfig.SectionName) as ExpressionBuilderConfig; if (configSection == null) { return; } - settings.SupportedTypes = new List(); foreach (ExpressionBuilderConfig.SupportedTypeElement supportedType in configSection.SupportedTypes) { Type type = Type.GetType(supportedType.Type, false, true); @@ -53,4 +53,4 @@ public static void LoadSettings(Settings settings) #endif } } -} \ No newline at end of file +}