RulesEngine
RulesEngine copied to clipboard
Operator '==' cannot be applied to operands of type 'System.Text.Json.JsonElement' and '<null>'
Version:v5.0.3
Issue
I tried the demo/DemoApp/JSONDemo.cs and got the below error:
[11:03:38 ERR] Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: Operator '==' cannot be applied to operands of type 'System.Text.Json.JsonElement' and '<null>'
at CallSite.Target(Closure, CallSite, Object, Object)
at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
Troubleshoot
Trying to troubleshoot, I found that the issue comes from RulesEngine.HelperFunctions.Utils.CreateAbstractClassType when it try to compare the JsonValueKind with null
if (input == null)
{
return typeof(object);
}
Exactly the same goes for demo/DemoApp/EFDemo.cs.
this repository is not being maintained anymore. move your issue to one of the maintained forks.
Thank @asulwer, your fork works for me