Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 6d399c5

Browse files
committed
suppress NRE
1 parent c86361f commit 6d399c5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/ServiceStack.Text/AutoMappingUtils.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ public static class AutoMappingUtils
2020
{
2121
public static T ConvertTo<T>(this object from)
2222
{
23+
if (from == null)
24+
return default(T);
25+
2326
if (from.GetType() == typeof(T))
2427
{
2528
return (T)from;

0 commit comments

Comments
 (0)