Bind
Bind copied to clipboard
crash when execption is raised within expression called via DynamicInvoke
I have a change proposal for
public static object EvalExpression (Expression expr)
Instead of:
return lambda.Compile ().DynamicInvoke ();
you could do this:
var deleg = lambda.Compile ();
try {
return deleg.DynamicInvoke ();
}
catch (Exception ex) {
return null;
}
This prevents the application from crashing whenever the expressen called via DynamicInvoke throws an exception. Any contraindication?