Skip to content

Commit 45dc6b3

Browse files
committed
chore: lints redundant checks
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
1 parent 06fb78f commit 45dc6b3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Microsoft.OpenApi/Models/JsonSchemaReference.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,10 @@ protected override void SetAdditional31MetadataFromMapNode(JsonObject jsonObject
157157

158158
// Extensions (properties starting with "x-")
159159
foreach (var property in jsonObject
160-
.Where(static p => p.Key.StartsWith(OpenApiConstants.ExtensionFieldNamePrefix, StringComparison.OrdinalIgnoreCase))
161-
.Where(static p => p.Value is JsonNode))
160+
.Where(static p => p.Key.StartsWith(OpenApiConstants.ExtensionFieldNamePrefix, StringComparison.OrdinalIgnoreCase)
161+
&& p.Value is not null))
162162
{
163-
var extensionValue = (JsonNode)property.Value!;
163+
var extensionValue = property.Value!;
164164
Extensions ??= new Dictionary<string, IOpenApiExtension>(StringComparer.OrdinalIgnoreCase);
165165
Extensions[property.Key] = new JsonNodeExtension(extensionValue.DeepClone());
166166
}

0 commit comments

Comments
 (0)