Skip to content

Commit

Permalink
fix: null reference check
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Biret <[email protected]>
  • Loading branch information
baywet committed Jan 31, 2025
1 parent ac05342 commit a5023d6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Microsoft.OpenApi/Models/OpenApiSchema.cs
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,7 @@ private void SerializeTypeProperty(JsonSchemaType? type, IOpenApiWriter writer,
{
// check whether nullable is true for upcasting purposes
var isNullable = Nullable ||
Extensions is not null &&
Extensions.TryGetValue(OpenApiConstants.NullableExtension, out var nullExtRawValue) &&
nullExtRawValue is OpenApiAny openApiAny &&
openApiAny.Node is JsonNode jsonNode &&
Expand Down

0 comments on commit a5023d6

Please sign in to comment.