From f9543cddaed02c10c30dde4ef5db2db40bf8cbc2 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Tue, 13 Sep 2022 12:31:26 +0200 Subject: [PATCH] Fix NPE when fetching unfetchable cert --- .../src/main/java/pgp/wkd/discovery/DiscoveryResponse.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wkd-java/src/main/java/pgp/wkd/discovery/DiscoveryResponse.java b/wkd-java/src/main/java/pgp/wkd/discovery/DiscoveryResponse.java index e1b6ac1..dc2ab99 100644 --- a/wkd-java/src/main/java/pgp/wkd/discovery/DiscoveryResponse.java +++ b/wkd-java/src/main/java/pgp/wkd/discovery/DiscoveryResponse.java @@ -12,6 +12,7 @@ import pgp.wkd.exception.MissingPolicyFileException; import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.net.URI; +import java.util.ArrayList; import java.util.List; /** @@ -170,8 +171,8 @@ public final class DiscoveryResponse { private DiscoveryMethod discoveryMethod; private WKDAddress address; - private List acceptableCertificates; - private List rejectedCertificates; + private List acceptableCertificates = new ArrayList<>(); + private List rejectedCertificates = new ArrayList<>(); private Throwable fetchingFailure; private WKDPolicy policy; private MissingPolicyFileException missingPolicyFileException;