Skip to content

Cannot add variable with null value #104

@MHDSAEEDRABID

Description

@MHDSAEEDRABID

I want to try to evaluate this simple expression .
in this code I've added variable to VariableCollection
variable name : "startDate" .
variable value : null
note : the type of Variable Collection (Dictionary) value is object

the issue : I got this exception
System.ArgumentNullException: 'Value cannot be null. (Parameter 'value')'

ExpressionContext context = new ExpressionContext();
string expression = @"(startDate > ""2020-05-01""))";

var varaibles = context.Variables;
//Add variable with name startDate with null value
varaibles.Add("startDate",null);

var compile = context.CompileGeneric<bool>(expression);
var result = compile.Evaluate();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions