You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
X509Certificate2Collection.Contains throws ArgumentNullException when
a null value is passed in, but the IList.Contains implementation and
X509CertificateCollection.Contains do not. This commit changes
X509Certificate2Collection.Contains to not throw for a null value to
be consistent with the IList.Contains implementation and
X509CertificateCollection.Contains.
Copy file name to clipboardExpand all lines: src/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/X509Certificate2Collection.cs
+3-2Lines changed: 3 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -94,8 +94,9 @@ public void AddRange(X509Certificate2Collection certificates)
94
94
95
95
publicboolContains(X509Certificate2certificate)
96
96
{
97
-
if(certificate==null)
98
-
thrownewArgumentNullException("certificate");
97
+
// This method used to throw ArgumentNullException, but it has been deliberately changed
98
+
// to no longer throw to match the behavior of X509CertificateCollection.Contains and the
99
+
// IList.Contains implementation, which do not throw.
0 commit comments