From a76664767cee488582ba511046a1f8bfd13f89dc Mon Sep 17 00:00:00 2001 From: Oded Hanson Date: Sat, 26 Jun 2021 16:37:59 +0300 Subject: [PATCH] minor optimization: move creation of X509 Subject Summary into catch block on MacOS. (#54774) --- .../src/Internal/Cryptography/Pal.OSX/AppleCertificatePal.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.OSX/AppleCertificatePal.cs b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.OSX/AppleCertificatePal.cs index 07959c3..5334d9e 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.OSX/AppleCertificatePal.cs +++ b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.OSX/AppleCertificatePal.cs @@ -399,7 +399,6 @@ namespace Internal.Cryptography.Pal return; Debug.Assert(!_certHandle.IsInvalid); - string? subjectSummary = Interop.AppleCrypto.X509GetSubjectSummary(_certHandle); try { @@ -407,6 +406,7 @@ namespace Internal.Cryptography.Pal } catch (CryptographicException e) { + string? subjectSummary = Interop.AppleCrypto.X509GetSubjectSummary(_certHandle); if (subjectSummary is null) { throw; -- 2.7.4