fixed issue with setter not handling null values exposed by failing unit test
This commit is contained in:
@@ -67,7 +67,7 @@ public record TemplateItem
|
||||
}
|
||||
set
|
||||
{
|
||||
_type = string.Intern(value);
|
||||
_type = value != null ? string.Intern(value) : null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,15 @@ public class ReflectionsCloner(ISptLogger<ReflectionsCloner> logger) : ICloner
|
||||
|
||||
public T? Clone<T>(T? obj)
|
||||
{
|
||||
return (T?) Clone(obj, typeof(T)).Result;
|
||||
try
|
||||
{
|
||||
return (T?) Clone(obj, typeof(T)).Result;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
logger.Error("cloning error:", e);
|
||||
return default;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<object?> Clone(object? obj, Type objectType)
|
||||
|
||||
Reference in New Issue
Block a user