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