From df45be031e993d1102ee009f6290c371fc511189 Mon Sep 17 00:00:00 2001 From: Safia Abdalla Date: Thu, 28 Dec 2023 20:01:30 -0800 Subject: [PATCH] Harden SignatureEquals nullability checks --- .../gen/StaticRouteHandlerModel/Endpoint.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Http/Http.Extensions/gen/StaticRouteHandlerModel/Endpoint.cs b/src/Http/Http.Extensions/gen/StaticRouteHandlerModel/Endpoint.cs index b16be0047a2d..7e7a180fe4d9 100644 --- a/src/Http/Http.Extensions/gen/StaticRouteHandlerModel/Endpoint.cs +++ b/src/Http/Http.Extensions/gen/StaticRouteHandlerModel/Endpoint.cs @@ -108,8 +108,13 @@ public override int GetHashCode() => public static bool SignatureEquals(Endpoint a, Endpoint b) { + if (a == null || b == null) + { + return false; + } + if (!string.Equals(a.Response?.WrappedResponseType, b.Response?.WrappedResponseType, StringComparison.Ordinal) || - !a.HttpMethod.Equals(b.HttpMethod, StringComparison.Ordinal) || + !string.Equals(a.HttpMethod, b.HttpMethod, StringComparison.Ordinal) || a.Parameters.Length != b.Parameters.Length) { return false;