Retry: Update ObjectConverter to not throw when value is null

This commit is contained in:
Sipke Schoorstra 2021-10-01 19:28:39 +02:00
parent e0f57a7ac0
commit 2a01f6c5a7

View file

@ -9,7 +9,7 @@ namespace Elsa
{
public static class ObjectConverter
{
public static T? ConvertTo<T>(this object? value) => (T?) value?.ConvertTo(typeof(T));
public static T? ConvertTo<T>(this object? value) => value != null ? (T?)value.ConvertTo(typeof(T)) : default;
public static object? ConvertTo(this object? value, Type targetType)
{