Skip to content

Commit 05cc3b7

Browse files
authored
Merge pull request #106 from stg609/master
Fix if member == null, and EvaluateVariable set Value = null on purpo…
2 parents ed10ac2 + 97d02c8 commit 05cc3b7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2258,6 +2258,7 @@ where method.GetParameters()[0].ParameterType == objType // static extMethod(thi
22582258
pushVarValue = false;
22592259
}
22602260

2261+
bool isVarValueSet = false;
22612262
if (member == null && pushVarValue)
22622263
{
22632264
VariableEvaluationEventArg variableEvaluationEventArg = new VariableEvaluationEventArg(varFuncName, this, obj ?? keepObj, genericsTypes, GetConcreteTypes);
@@ -2267,10 +2268,11 @@ where method.GetParameters()[0].ParameterType == objType // static extMethod(thi
22672268
if (variableEvaluationEventArg.HasValue)
22682269
{
22692270
varValue = variableEvaluationEventArg.Value;
2271+
isVarValueSet = true;
22702272
}
22712273
}
22722274

2273-
if (!isDynamic && varValue == null && pushVarValue)
2275+
if (!isVarValueSet && !isDynamic && varValue == null && pushVarValue)
22742276
{
22752277
varValue = ((dynamic)member).GetValue(obj);
22762278

0 commit comments

Comments
 (0)