summary refs log tree commit diff
path: root/crypto/src/asn1/x509/X509Name.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2020-02-21 18:04:07 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2020-02-21 18:04:07 +0700
commitb204309029cd6bd92d8a20e5778e6cf328bf7745 (patch)
treeda220b61292493a744a210c2c7e00740468838a2 /crypto/src/asn1/x509/X509Name.cs
parentImprovements to permitted sub-trees (diff)
downloadBouncyCastle.NET-ed25519-b204309029cd6bd92d8a20e5778e6cf328bf7745.tar.xz
Update ASN.1 GetInstance methods
Diffstat (limited to '')
-rw-r--r--crypto/src/asn1/x509/X509Name.cs10
1 files changed, 4 insertions, 6 deletions
diff --git a/crypto/src/asn1/x509/X509Name.cs b/crypto/src/asn1/x509/X509Name.cs
index c3c3cc6c9..bd8f9fb3e 100644
--- a/crypto/src/asn1/x509/X509Name.cs
+++ b/crypto/src/asn1/x509/X509Name.cs
@@ -364,13 +364,11 @@ namespace Org.BouncyCastle.Asn1.X509
         public static X509Name GetInstance(
             object obj)
         {
-            if (obj == null || obj is X509Name)
+            if (obj is X509Name)
                 return (X509Name)obj;
-
-            if (obj != null)
-                return new X509Name(Asn1Sequence.GetInstance(obj));
-
-            throw new ArgumentException("null object in factory", "obj");
+            if (obj == null)
+                return null;
+            return new X509Name(Asn1Sequence.GetInstance(obj));
         }
 
         protected X509Name()