diff --git a/src/Mapster/TypeAdapter.cs b/src/Mapster/TypeAdapter.cs index 9389a9a2..0ac37924 100644 --- a/src/Mapster/TypeAdapter.cs +++ b/src/Mapster/TypeAdapter.cs @@ -96,8 +96,8 @@ public static TDestination Adapt(this TSource source, TDe /// Adapted destination type. public static TDestination Adapt(this TSource source, TDestination destination, TypeAdapterConfig config) { - var sourceType = source.GetType(); - var destinationType = destination.GetType(); + var sourceType = source?.GetType(); + var destinationType = destination?.GetType(); if (sourceType == typeof(object)) // Infinity loop in ObjectAdapter if Runtime Type of source is Object return destination;