From edb85cfdd8128359e43ea10023dc3553792b1110 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=CC=88rg=20Prante?= Date: Sun, 4 Mar 2018 23:14:26 +0100 Subject: [PATCH] fix NPE --- .gitignore | 2 +- build.gradle | 4 ++++ src/main/java/org/xbib/netty/http/client/Client.java | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 57262d8..a8f6dba 100644 --- a/.gitignore +++ b/.gitignore @@ -9,5 +9,5 @@ /.project /.gradle /build -/out +out *~ \ No newline at end of file diff --git a/build.gradle b/build.gradle index 31bfb88..1e29b59 100644 --- a/build.gradle +++ b/build.gradle @@ -71,6 +71,10 @@ test { } } +clean { + delete 'out' +} + asciidoctor { attributes toc: 'left', doctype: 'book', diff --git a/src/main/java/org/xbib/netty/http/client/Client.java b/src/main/java/org/xbib/netty/http/client/Client.java index 532b598..8700e76 100644 --- a/src/main/java/org/xbib/netty/http/client/Client.java +++ b/src/main/java/org/xbib/netty/http/client/Client.java @@ -104,7 +104,7 @@ public final class Client { this.http2ResponseHandler = new Http2ResponseHandler(); this.transports = new CopyOnWriteArrayList<>(); List nodes = clientConfig.getNodes(); - if (!nodes.isEmpty()) { + if (nodes != null && !nodes.isEmpty()) { Integer limit = clientConfig.getNodeConnectionLimit(); if (limit == null || limit > nodes.size()) { limit = nodes.size();