Small improvements

This commit is contained in:
2025-01-24 16:03:30 +01:00
parent 86c22cfe85
commit 81c4915d16
2 changed files with 9 additions and 43 deletions

View File

@@ -123,10 +123,10 @@ namespace DynamORM.Mapper
private Func<object, object> CreateGetter(PropertyInfo property)
{
if (!property.CanRead)
if (property == null || !property.CanRead)
return null;
ParameterExpression objParm = Expression.Parameter(typeof(object), "o");
var objParm = Expression.Parameter(typeof(object), "o");
return Expression.Lambda<Func<object, object>>(
Expression.Convert(
@@ -141,8 +141,8 @@ namespace DynamORM.Mapper
if (!property.CanWrite)
return null;
ParameterExpression objParm = Expression.Parameter(typeof(object), "o");
ParameterExpression valueParm = Expression.Parameter(typeof(object), "value");
var objParm = Expression.Parameter(typeof(object), "o");
var valueParm = Expression.Parameter(typeof(object), "value");
return Expression.Lambda<Action<object, object>>(
Expression.Assign(