GetCustomSupportedTypes (ExpressionBuilder.Helpers.OperationHelper) throws NullReferenceException when you don't have the config section defined in your project.
foreach (var supportedType in _settings.SupportedTypes) { if (supportedType.Type != null) { TypeGroups[supportedType.TypeGroup].Add(supportedType.Type); } }
This foreach loop throws an exception since _settings.SupportedTypes is null.
Suggested change:
In ExpressionBuilder.Configuration.Settings class, LoadSettings method:
var configSection = ConfigurationManager.GetSection(ExpressionBuilderConfig.SectionName) as ExpressionBuilderConfig; if (configSection == null) { settings.SupportedTypes = new List(); return; }
I've added the part in bold. This seems to fix the problem.
GetCustomSupportedTypes (ExpressionBuilder.Helpers.OperationHelper) throws NullReferenceException when you don't have the config section defined in your project.
foreach (var supportedType in _settings.SupportedTypes) { if (supportedType.Type != null) { TypeGroups[supportedType.TypeGroup].Add(supportedType.Type); } }
This foreach loop throws an exception since _settings.SupportedTypes is null.
Suggested change: In ExpressionBuilder.Configuration.Settings class, LoadSettings method:
var configSection = ConfigurationManager.GetSection(ExpressionBuilderConfig.SectionName) as ExpressionBuilderConfig; if (configSection == null) {
settings.SupportedTypes = new Listreturn; }
I've added the part in bold. This seems to fix the problem.