From 89c6477b32cf7dd2a97d2a23d4aa9700cc3ba315 Mon Sep 17 00:00:00 2001 From: nico_dreylaq Date: Thu, 16 Jan 2025 14:22:12 +0100 Subject: [PATCH] refactor: remove duplicate null checks --- Utils/src/ServerCertificateValidator.cs | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/Utils/src/ServerCertificateValidator.cs b/Utils/src/ServerCertificateValidator.cs index ddaad7091..55a9634d6 100644 --- a/Utils/src/ServerCertificateValidator.cs +++ b/Utils/src/ServerCertificateValidator.cs @@ -58,18 +58,6 @@ public static RemoteCertificateValidationCallback ValidationCallback(ILogger return false; } - if (certificate == null) - { - logger.LogDebug("Certificate is null!"); - return false; - } - - if (chain == null) - { - logger.LogDebug("Certificate chain is null!"); - return false; - } - // If there is any error other than untrusted root or partial chain, fail the validation if (chain.ChainStatus.Any(status => status.Status is not X509ChainStatusFlags.UntrustedRoot and not X509ChainStatusFlags.PartialChain)) {