summary refs log tree commit diff
diff options
context:
space:
mode:
-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);