From 07cdc77dd96808d09048f7458e1eb741fedd3456 Mon Sep 17 00:00:00 2001 From: Elizabeth Okerio Date: Tue, 18 Apr 2023 09:04:30 +0300 Subject: [PATCH] fix regression issue. (#2769) --- .../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);