diff options
Diffstat (limited to 'crypto/src/asn1/Asn1ObjectDescriptor.cs')
-rw-r--r-- | crypto/src/asn1/Asn1ObjectDescriptor.cs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/crypto/src/asn1/Asn1ObjectDescriptor.cs b/crypto/src/asn1/Asn1ObjectDescriptor.cs index c4b27ca8c..8d41fa4e4 100644 --- a/crypto/src/asn1/Asn1ObjectDescriptor.cs +++ b/crypto/src/asn1/Asn1ObjectDescriptor.cs @@ -42,10 +42,9 @@ namespace Org.BouncyCastle.Asn1 if (obj is Asn1ObjectDescriptor asn1ObjectDescriptor) return asn1ObjectDescriptor; - if (obj is IAsn1Convertible asn1Convertible && !(obj is Asn1Object)) + if (obj is IAsn1Convertible asn1Convertible) { - Asn1Object asn1Object = asn1Convertible.ToAsn1Object(); - if (asn1Object is Asn1ObjectDescriptor converted) + if (!(obj is Asn1Object) && asn1Convertible.ToAsn1Object() is Asn1ObjectDescriptor converted) return converted; } else if (obj is byte[] bytes) |