summary refs log tree commit diff
path: root/crypto/src/x509/X509Certificate.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2022-06-28 00:20:12 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2022-06-28 00:20:12 +0700
commit1a1d8c5b92e086ed733e9ef554a4269b12f6f27a (patch)
tree5618feb9bea773b2925a6b46d2a5d89611597347 /crypto/src/x509/X509Certificate.cs
parentAdd extra IAN,SAN extension accessors (diff)
downloadBouncyCastle.NET-ed25519-1a1d8c5b92e086ed733e9ef554a4269b12f6f27a.tar.xz
Fix NPE
Diffstat (limited to '')
-rw-r--r--crypto/src/x509/X509Certificate.cs3
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);