From a4bda388d42ef522c9740ae7ad965a3d413006cc Mon Sep 17 00:00:00 2001 From: DocSvartz Date: Mon, 13 Jan 2025 15:29:14 +0500 Subject: [PATCH] fix nullable map to target regression --- src/Mapster/TypeAdapter.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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;