diff --git a/src/Microsoft.OpenApi.OData.Reader/Common/Utils.cs b/src/Microsoft.OpenApi.OData.Reader/Common/Utils.cs index 93ffc7e0..9c037889 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Common/Utils.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Common/Utils.cs @@ -238,7 +238,8 @@ internal static bool IsBaseTypeReferencedAsTypeInModel( if (isReferencedInAction) return true; // Recursively check the base type - return model.IsBaseTypeReferencedAsTypeInModel(baseType.BaseType, structuredTypes, actions); + if (baseType.BaseType is not null) + return model.IsBaseTypeReferencedAsTypeInModel(baseType.BaseType, structuredTypes, actions); } return false;