summary refs log tree commit diff
path: root/crypto/src/asn1/Asn1GeneralizedTime.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/asn1/Asn1GeneralizedTime.cs')
-rw-r--r--crypto/src/asn1/Asn1GeneralizedTime.cs5
1 files changed, 2 insertions, 3 deletions
diff --git a/crypto/src/asn1/Asn1GeneralizedTime.cs b/crypto/src/asn1/Asn1GeneralizedTime.cs
index 704b6a8bc..4fe5561a0 100644
--- a/crypto/src/asn1/Asn1GeneralizedTime.cs
+++ b/crypto/src/asn1/Asn1GeneralizedTime.cs
@@ -31,10 +31,9 @@ namespace Org.BouncyCastle.Asn1
             if (obj is Asn1GeneralizedTime asn1GeneralizedTime)
                 return asn1GeneralizedTime;
 
-            if (obj is IAsn1Convertible asn1Convertible && !(obj is Asn1Object))
+            if (obj is IAsn1Convertible asn1Convertible)
             {
-                Asn1Object asn1Object = asn1Convertible.ToAsn1Object();
-                if (asn1Object is Asn1GeneralizedTime converted)
+                if (!(obj is Asn1Object) && asn1Convertible.ToAsn1Object() is Asn1GeneralizedTime converted)
                     return converted;
             }
             else if (obj is byte[] bytes)