nreco/lambdaparser

Exception when checking for null and other bool condition

Shekesh opened this issue · 1 comments

Hello,

when I try the following code

var value = "testString";
var env = new Dictionary<string, object>();
env.Add("value", value);
var parser = new LambdaParser();
string res = (string)parser.Eval("value != null && value.Contains(\"t\") ? \"contains\" : \"does not contain\"", env);

I get this exception: System.InvalidOperationException: "The binary operator AndAlso is not defined for the types 'System.Boolean' and 'NReco.Linq.LambdaParameterWrapper'."

There seems to be a problem combining a check for null with another condition. If I do only the null check there is no problem.

Fixed in 1.0.7