ConditionalAnd with variables
See original GitHub issueFirst, I want to say it’s a fascinating and high-quality module, congratulations and thank you for putting it up here!
I have a problem evaluating expressions with variables when using ConditionalAnd and null values:
Dictionary<string, object> dictValues = new Dictionary<string, object>();
string nullString = null;
dictValues[ "TestNullString" ] = nullString;
//pass dictValues as expEval.Variables into expression evaluation instance and then...
string expression = "!string.IsNullOrEmpty(TestNullString) && TestNullString.StartsWith(\"ABC\")";
var result = expEval.Evaluate(expression);
This throws a NullReferenceException with the second half, where “plain C#” would skip evaluating this part. The issue seems related to some that were discussed here recently, especially #51 and #53, but the fixes don’t address it. The exception details are:
at ExpressionEvaluator.DetermineInstanceOrStatic(Type& objType, Object& obj, ValueTypeNestingTrace& valueTypeNestingTrace) in EvaluatorTest\ExpressionEvaluator.cs
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (7 by maintainers)
Top Results From Across the Web
Conditionals, loops, variables and functions | Codelearn.com
The first one is the simplest, the first conditional we have seen: if the condition happens, we do the action that is associated...
Read more >How to make a conditional variable based on multiple ...
Trying to make a catch all variable - so if a respondent answers "yes" to at least one of the 9 yes/no variables,...
Read more >Conditional Statements with Variables - YouTube
In this video, we discuss how open primitive statements affect conditional statements that they are apart of.
Read more >Variables and Conditional Statements
This month we will take a look and explain variables and conditional statements. ... This program is quite simple and has one variable...
Read more >How to use “&” and “|” to combine conditional statements in R
In the example below, we use the & operator to combine conditional statements that will test if a variable value is greater or...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello @codingseb, I am a coworker of @HelgeL and we had another look at the problem. We figured out a way to realize left associativity and put together a solution that’s working for our cases and passes all of your test cases as well. I will add a few comments to it and than suggest a pull request for our fork. Maybe it will help you or others.
Just published version 1.4.13.0 with additionals corrections for this. And some Refactoring and simplification.