Skip to content

Commit 6bc5ab5

Browse files
committed
cosmetic
1 parent 4e86a15 commit 6bc5ab5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/AutoMapper/Configuration/MapperConfiguration.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,8 @@ static Expression CheckNullValueType(Expression expression, Type runtimeType) =>
210210
LambdaExpression GenerateObjectMapperExpression(in MapRequest mapRequest, IObjectMapper mapper)
211211
{
212212
var source = Parameter(mapRequest.RequestedTypes.SourceType, "source");
213-
var destination = Parameter(mapRequest.RequestedTypes.DestinationType, "mapperDestination");
213+
var destinationType = mapRequest.RequestedTypes.DestinationType;
214+
var destination = Parameter(destinationType, "mapperDestination");
214215
var runtimeDestinationType = mapRequest.RuntimeTypes.DestinationType;
215216
Expression fullExpression;
216217
bool nullCheck;
@@ -230,8 +231,7 @@ LambdaExpression GenerateObjectMapperExpression(in MapRequest mapRequest, IObjec
230231
var map = mapper.MapExpression(this, Configuration, mapRequest.MemberMap, mapperSource, ToType(checkNullValueTypeDest, runtimeDestinationType));
231232
nullCheck = map != mapperSource;
232233
var newException = Call(MappingError, ExceptionParameter, Constant(mapRequest));
233-
var throwExpression = Throw(newException, destination.Type);
234-
fullExpression = TryCatch(ToType(map, destination.Type), Catch(ExceptionParameter, throwExpression));
234+
fullExpression = TryCatch(ToType(map, destinationType), Catch(ExceptionParameter, Throw(newException, destinationType)));
235235
}
236236
if (nullCheck)
237237
{

0 commit comments

Comments
 (0)