diff --git a/Data_Eval/Data_Eval/Data_Eval.csproj b/Data_Eval/Data_Eval/Data_Eval.csproj index 20081b1..15d7997 100644 --- a/Data_Eval/Data_Eval/Data_Eval.csproj +++ b/Data_Eval/Data_Eval/Data_Eval.csproj @@ -7,7 +7,7 @@ true false Data_Eval.snk - 2.4.3 + 2.4.4 diff --git a/Data_Eval/Data_Eval/Data_Eval.nuspec b/Data_Eval/Data_Eval/Data_Eval.nuspec index acfdefc..319a1b2 100644 --- a/Data_Eval/Data_Eval/Data_Eval.nuspec +++ b/Data_Eval/Data_Eval/Data_Eval.nuspec @@ -2,7 +2,7 @@ Data.Eval - 2.4.3 + 2.4.4 Data.Eval Bruce Dunwiddie shriop diff --git a/Data_Eval/Data_Eval/Evaluator.cs b/Data_Eval/Data_Eval/Evaluator.cs index 4dab68b..6572c1c 100644 --- a/Data_Eval/Data_Eval/Evaluator.cs +++ b/Data_Eval/Data_Eval/Evaluator.cs @@ -321,6 +321,13 @@ private void InitExec(string caller) { references.Add(caller); + // add references to containing assemblies for all used variable types + variables + .Select(v => v.Value.Type.Assembly.Location) + .Distinct() + .ToList() + .ForEach(a => references.Add(a)); + execution = new Execution(); Compiler compiler = new Compiler(); diff --git a/Data_Eval/Tests/EvaluatorTests.cs b/Data_Eval/Tests/EvaluatorTests.cs index 4492026..ee7ae22 100644 --- a/Data_Eval/Tests/EvaluatorTests.cs +++ b/Data_Eval/Tests/EvaluatorTests.cs @@ -181,5 +181,19 @@ public void Evaluator_DynamicVariable() Assert.AreEqual("something", evaluator.Eval()); } + + [Test] + public void Evaluator_NullVariableComparison() + { + var evaluator = new Evaluator( + "return test == null"); + + evaluator.SetVariable( + "test", + null, + typeof(string)); + + Assert.IsTrue(evaluator.Eval()); + } } }