From f007a46e622f82badab127c5a9870918e0dfd57c Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Thu, 6 Oct 2022 18:22:40 +0700 Subject: Fix exception type --- crypto/src/pkix/PkixCertPathValidatorResult.cs | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/crypto/src/pkix/PkixCertPathValidatorResult.cs b/crypto/src/pkix/PkixCertPathValidatorResult.cs index 693ded89c..07cb350c1 100644 --- a/crypto/src/pkix/PkixCertPathValidatorResult.cs +++ b/crypto/src/pkix/PkixCertPathValidatorResult.cs @@ -31,20 +31,14 @@ namespace Org.BouncyCastle.Pkix get { return this.subjectPublicKey; } } - public PkixCertPathValidatorResult( - TrustAnchor trustAnchor, - PkixPolicyNode policyTree, - AsymmetricKeyParameter subjectPublicKey) + public PkixCertPathValidatorResult(TrustAnchor trustAnchor, PkixPolicyNode policyTree, + AsymmetricKeyParameter subjectPublicKey) { - if (subjectPublicKey == null) - { - throw new NullReferenceException("subjectPublicKey must be non-null"); - } - if (trustAnchor == null) - { - throw new NullReferenceException("trustAnchor must be non-null"); - } - + if (trustAnchor == null) + throw new ArgumentNullException(nameof(trustAnchor)); + if (subjectPublicKey == null) + throw new ArgumentNullException(nameof(subjectPublicKey)); + this.trustAnchor = trustAnchor; this.policyTree = policyTree; this.subjectPublicKey = subjectPublicKey; -- cgit 1.4.1