From 17c357805810c29100ebd8c77f8cf4079b8aefdd Mon Sep 17 00:00:00 2001 From: Elizabeth Okerio Date: Thu, 6 Apr 2023 12:11:52 +0300 Subject: [PATCH] fix regression issue. --- .../Formatter/Serialization/ODataResourceSerializer.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataResourceSerializer.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataResourceSerializer.cs index d8f2d80709..c286c5f986 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataResourceSerializer.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataResourceSerializer.cs @@ -1743,9 +1743,9 @@ private IEnumerable> GetPro { if (changedProperties == null || changedProperties.Contains(complexProperty.Key.Name)) { - IEdmTypeReference type = complexProperty.Key == null ? null : complexProperty.Key.Type; + IEdmTypeReference type = complexProperty.Key?.Type; - if (type != null && resourceContext.EdmModel != null) + if (type != null && type.IsStructured() && resourceContext.EdmModel != null) { Type clrType = EdmLibHelpers.GetClrType(type.AsStructured(), resourceContext.EdmModel);