Skip to content

Commit

Permalink
Merge pull request MapsterMapper#583 from msadeqsirjani/master
Browse files Browse the repository at this point in the history
🐛 fix(TypeAdapter.cs): Make source parameter nullable
  • Loading branch information
andrerav committed May 29, 2023
2 parents b8eba45 + b4daba7 commit 1821035
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Mapster/TypeAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public static TypeAdapterBuilder<TSource> BuildAdapter<TSource>(this TSource sou
/// <typeparam name="TDestination">Destination type.</typeparam>
/// <param name="source">Source object to adapt.</param>
/// <returns>Adapted destination type.</returns>
public static TDestination Adapt<TDestination>(this object source)
public static TDestination Adapt<TDestination>(this object? source)
{
return Adapt<TDestination>(source, TypeAdapterConfig.GlobalSettings);
}
Expand All @@ -33,7 +33,7 @@ public static TDestination Adapt<TDestination>(this object source)
/// <param name="source">Source object to adapt.</param>
/// <param name="config">Configuration</param>
/// <returns>Adapted destination type.</returns>
public static TDestination Adapt<TDestination>(this object source, TypeAdapterConfig config)
public static TDestination Adapt<TDestination>(this object? source, TypeAdapterConfig config)
{
// ReSharper disable once ConditionIsAlwaysTrueOrFalse
if (source == null)
Expand Down

0 comments on commit 1821035

Please sign in to comment.