Skip to content

Commit c76f773

Browse files
author
Samuel Huylebroeck
committed
Guard against NPE in CrlClientOnline
This is the 7.0 branch commit. DEVSIX-1756
1 parent c21fbdb commit c76f773

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

sign/src/main/java/com/itextpdf/signatures/CrlClientOnline.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,12 @@ public CrlClientOnline(Certificate[] chain) {
106106
for (int i = 0; i < chain.length; i++) {
107107
X509Certificate cert = (X509Certificate) chain[i];
108108
LOGGER.info("Checking certificate: " + cert.getSubjectDN());
109+
String url = null;
109110
try {
110-
addUrl(CertificateUtil.getCRLURL(cert));
111+
url = CertificateUtil.getCRLURL(cert);
112+
if(url!=null) {
113+
addUrl(url);
114+
}
111115
} catch (CertificateParsingException e) {
112116
LOGGER.info("Skipped CRL url (certificate could not be parsed)");
113117
}

0 commit comments

Comments
 (0)