Skip to content

Commit 22ac7a7

Browse files
committed
.Net 10
1 parent ad08b13 commit 22ac7a7

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

src/EntityFrameworkCore.SqlServer.SimpleBulks/PropertiesCache.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,19 +283,24 @@ public static object GetFlattenedPropertyValueOptimized(string name, T item)
283283

284284
public static object GetPropertyValue(string propName, T item, IReadOnlyDictionary<string, ValueConverter> valueConverters)
285285
{
286+
var value = GetPropertyValueOptimized(propName, item);
287+
286288
if (valueConverters != null && valueConverters.TryGetValue(propName, out var converter))
287289
{
288290
if (converter is JsonValueConverter jsonValueConverter)
289291
{
292+
if (value == null)
293+
{
294+
return null;
295+
}
296+
290297
return JsonPropertyWriter.Write(item, jsonValueConverter.FlattenedJsonProperties);
291298
}
292299

293-
var value = GetPropertyValueOptimized(propName, item);
294-
295300
return converter.ConvertToProvider(value);
296301
}
297302

298-
return GetPropertyValueOptimized(propName, item);
303+
return value;
299304
}
300305

301306
public static void SetPropertyValueReflection(string name, T item, object value)

0 commit comments

Comments
 (0)