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