Skip to content

Commit f0dc51d

Browse files
committed
fix: a bug where checking the whether a type is referenced would lead to a null reference exception
Signed-off-by: Vincent Biret <[email protected]>
1 parent d6582f5 commit f0dc51d

File tree

1 file changed

+2
-1
lines changed
  • src/Microsoft.OpenApi.OData.Reader/Common

1 file changed

+2
-1
lines changed

src/Microsoft.OpenApi.OData.Reader/Common/Utils.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,8 @@ internal static bool IsBaseTypeReferencedAsTypeInModel(
238238
if (isReferencedInAction) return true;
239239

240240
// Recursively check the base type
241-
return model.IsBaseTypeReferencedAsTypeInModel(baseType.BaseType, structuredTypes, actions);
241+
if (baseType.BaseType is not null)
242+
return model.IsBaseTypeReferencedAsTypeInModel(baseType.BaseType, structuredTypes, actions);
242243
}
243244

244245
return false;

0 commit comments

Comments
 (0)