RuleEditor.GetClientSettings() 在从 v5.0.14.6 升级到 v5.0.19.4 后在通用方法上抛出 NRE
RuleEditor.GetClientSettings() throws NRE on generic Method after upgrading to v5.0.19.4 from v5.0.14.6
在我将 CodeEffects.Rule.Editor.Web.Core
nuget 从 v5.0.14.6 升级到 v5.0.19.4 后,我在调用 RuleEditor.GetClientSettings()
时得到以下 NullReferenceException
:
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()
通过排除,我将注意力集中在以下方法上,这似乎是导致错误的原因(这在 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;
}
在我将 CodeEffects.Rule.Editor.Web.Core
nuget 从 v5.0.14.6 升级到 v5.0.19.4 后,我在调用 RuleEditor.GetClientSettings()
时得到以下 NullReferenceException
:
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()
通过排除,我将注意力集中在以下方法上,这似乎是导致错误的原因(这在 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;
}