diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2022-06-28 00:20:12 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2022-06-28 00:20:12 +0700 |
commit | 1a1d8c5b92e086ed733e9ef554a4269b12f6f27a (patch) | |
tree | 5618feb9bea773b2925a6b46d2a5d89611597347 /crypto/src/x509/X509Certificate.cs | |
parent | Add extra IAN,SAN extension accessors (diff) | |
download | BouncyCastle.NET-ed25519-1a1d8c5b92e086ed733e9ef554a4269b12f6f27a.tar.xz |
Fix NPE
Diffstat (limited to 'crypto/src/x509/X509Certificate.cs')
-rw-r--r-- | crypto/src/x509/X509Certificate.cs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/crypto/src/x509/X509Certificate.cs b/crypto/src/x509/X509Certificate.cs index 56d9e639f..cc390f360 100644 --- a/crypto/src/x509/X509Certificate.cs +++ b/crypto/src/x509/X509Certificate.cs @@ -413,6 +413,9 @@ namespace Org.BouncyCastle.X509 protected virtual IList<IList<object>> GetAlternativeNames(DerObjectIdentifier oid) { var generalNames = GetAlternativeNameExtension(oid); + if (generalNames == null) + return null; + var gns = generalNames.GetNames(); var result = new List<IList<object>>(gns.Length); |