After I upgraded CodeEffects.Rule.Editor.Web.Core
nuget from v5.0.14.6 to v5.0.19.4, I'm getting the following NullReferenceException
when calling RuleEditor.GetClientSettings()
:
Message:
System.NullReferenceException : Object reference not set to an instance of an object.
Stack Trace:
Encoder.GetHashToken(MethodInfo m, String sourceTypeFullName)
SourceLoader.GetTokenByMethod(XmlNode source, Type type, Type sourceObject, String methodName, XmlNodeList parameters, Boolean isMethod)
SourceLoader.GetTokenBySourceMethodNode(XmlNode source, XmlNode method, Type sourceObject)
Settings.Load(IControl control, ICollection`1 contextMenuRules, XmlDocument sourceXml, ICollection`1 dataSourceHolders, Boolean plainSourceXml)
RuleEditor.GetConditions()
RuleEditor.GetClientSettings()
Through elimination I zeroed in to the following method, which seems to be causing the error (this worked in v5.0.14.6):
[Method("IsSingle")]
public bool IsSingle<T>([Parameter(ValueInputType.Fields, Description = "array")] IEnumerable<T> array)
{
return array != null && array.Distinct().SingleOrDefault() != null;
}