Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Null value causes Property to fail with object has no public Property or Member named [...] #67

Closed
doug-episource opened this issue Sep 22, 2020 · 2 comments
Assignees
Labels

Comments

@doug-episource
Copy link

Having a Dynamic Object with a null value for a Property results in the following error:

LogParsing.ExpressionEvaluatorSyntaxErrorException: '[System.Dynamic.ExpandoObject] object has no public Property or Member named "NullValue".'

            dynamic MyDynamic = new System.Dynamic.ExpandoObject();
            MyDynamic.NullValue = null;

            ExpressionEvaluator evaluator = new ExpressionEvaluator();
            evaluator.Variables = new Dictionary<string, object>()
            {
                  { "md", MyDynamic },
            };
            string expression = "md.NullValue ?? \"A\"";
            var exp = evaluator.Evaluate(expression);

Verified on the latest version of the code. Any ideas?

@codingseb
Copy link
Owner

Hello @doug-episource thanks for this issue.

Yes it was a bug in the way of evaluating properties on an ExpandoObject, I just published version 1.4.16.0 that correct it.

@doug-episource
Copy link
Author

Great news! Thank you so much for the quick response and fix for the the issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants