Skip to content

Commit 733b323

Browse files
CodeQL fix
1 parent 5f79843 commit 733b323

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Diff for: src/AspNetCore/WebApi/src/Asp.Versioning.Mvc.ApiExplorer/GroupedApiVersionDescriptionProvider.cs

+6-2
Original file line numberDiff line numberDiff line change
@@ -441,10 +441,14 @@ public GroupedApiVersionMetadata( string? groupName, ApiVersionMetadata metadata
441441
public string? GroupName { get; }
442442

443443
/// <inheritdoc />
444-
public bool Equals( GroupedApiVersionMetadata? other ) => other is not null && other.GetHashCode() == GetHashCode();
444+
public bool Equals( GroupedApiVersionMetadata? other ) =>
445+
other is not null && other.GetHashCode() == GetHashCode();
445446

446447
/// <inheritdoc />
447-
public override bool Equals( object? obj ) => Equals( obj as GroupedApiVersionMetadata );
448+
public override bool Equals( object? obj ) =>
449+
obj is not null &&
450+
GetType().Equals( obj.GetType() ) &&
451+
GetHashCode() == obj.GetHashCode();
448452

449453
/// <inheritdoc />
450454
public override int GetHashCode()

0 commit comments

Comments
 (0)