From 39c1b46ad02dcfc1423cf10e5912a982431a3fbc Mon Sep 17 00:00:00 2001 From: johan12345 Date: Wed, 21 Oct 2020 08:31:56 +0200 Subject: [PATCH] OpenSearch: fix NPE --- .../main/java/de/geeksfactory/opacclient/apis/OpenSearch.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opacclient/libopac/src/main/java/de/geeksfactory/opacclient/apis/OpenSearch.java b/opacclient/libopac/src/main/java/de/geeksfactory/opacclient/apis/OpenSearch.java index 330d67b4b..6a9261e5f 100644 --- a/opacclient/libopac/src/main/java/de/geeksfactory/opacclient/apis/OpenSearch.java +++ b/opacclient/libopac/src/main/java/de/geeksfactory/opacclient/apis/OpenSearch.java @@ -313,8 +313,8 @@ protected CompletableFuture assignBestCover(final CoverHolder result, } else { return asyncGet(url, false) .handle((response, throwable) -> { - response.close(); - if (throwable == null) { + if (response != null) response.close(); + if (throwable == null && response != null) { result.setCover(url); } else { assignBestCover(result, queue).join();