Skip to content

Commit

Permalink
Fix for nullable type conversion [npiaseck]
Browse files Browse the repository at this point in the history
  • Loading branch information
RupertAvery committed May 14, 2014
1 parent ae5087e commit ce647bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Parser/TypeConversion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public static Expression NullLiteralConverion(Expression dest, Expression src)
{
if (src.NodeType == ExpressionType.Constant && src.Type == typeof(object) && ((ConstantExpression)src).Value == null && Nullable.GetUnderlyingType(dest.Type) != null)
{
return Expression.Constant(Activator.CreateInstance(dest.Type, dest.Type.GetConstructor(new[] { dest.Type })), dest.Type);
return Expression.Constant(Activator.CreateInstance(dest.Type), dest.Type);
}
return src;
}
Expand Down

0 comments on commit ce647bc

Please sign in to comment.