From db9b19e3f17a2aee8afcd673ef9327bb8646b87a Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Wed, 1 Feb 2023 21:07:46 +0700 Subject: Overhaul Asn1.Cmp --- crypto/src/asn1/cmp/PollRepContent.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'crypto/src/asn1/cmp/PollRepContent.cs') diff --git a/crypto/src/asn1/cmp/PollRepContent.cs b/crypto/src/asn1/cmp/PollRepContent.cs index 15f153a5d..e8af7b7e9 100644 --- a/crypto/src/asn1/cmp/PollRepContent.cs +++ b/crypto/src/asn1/cmp/PollRepContent.cs @@ -11,13 +11,16 @@ namespace Org.BouncyCastle.Asn1.Cmp { public static PollRepContent GetInstance(object obj) { - if (obj is PollRepContent pollRepContent) - return pollRepContent; - - if (obj != null) - return new PollRepContent(Asn1Sequence.GetInstance(obj)); + if (obj == null) + return null; + if (obj is PollRepContent pollRepContent) + return pollRepContent; + return new PollRepContent(Asn1Sequence.GetInstance(obj)); + } - return null; + public static PollRepContent GetInstance(Asn1TaggedObject taggedObject, bool declaredExplicit) + { + return GetInstance(Asn1Sequence.GetInstance(taggedObject, declaredExplicit)); } private readonly DerInteger[] m_certReqID; -- cgit 1.4.1