RulesEngine icon indicating copy to clipboard operation
RulesEngine copied to clipboard

Operator '==' cannot be applied to operands of type 'System.Text.Json.JsonElement' and '<null>'

Open minhtranes opened this issue 1 year ago • 3 comments

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);
}

minhtranes avatar Sep 06 '24 05:09 minhtranes

Exactly the same goes for demo/DemoApp/EFDemo.cs.

ivaylood avatar Sep 12 '24 14:09 ivaylood

this repository is not being maintained anymore. move your issue to one of the maintained forks.

asulwer avatar Sep 12 '24 16:09 asulwer

Thank @asulwer, your fork works for me

minhtranes avatar Sep 16 '24 08:09 minhtranes