Skip to content

Commit a4bda38

Browse files
committed
fix nullable map to target regression
1 parent 3bf9e6b commit a4bda38

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Mapster/TypeAdapter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ public static TDestination Adapt<TSource, TDestination>(this TSource source, TDe
9696
/// <returns>Adapted destination type.</returns>
9797
public static TDestination Adapt<TSource, TDestination>(this TSource source, TDestination destination, TypeAdapterConfig config)
9898
{
99-
var sourceType = source.GetType();
100-
var destinationType = destination.GetType();
99+
var sourceType = source?.GetType();
100+
var destinationType = destination?.GetType();
101101

102102
if (sourceType == typeof(object)) // Infinity loop in ObjectAdapter if Runtime Type of source is Object
103103
return destination;

0 commit comments

Comments
 (0)