From 8b0a2f1632f8fff485dbab0455f11a8ea1e8b857 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Wed, 18 Sep 2019 07:10:32 +0200 Subject: fix possible NullPointerException in HttpClientFactory.java --- .../at/gv/egiz/eaaf/core/impl/utils/HttpClientFactory.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'eaaf_core_utils/src') diff --git a/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/utils/HttpClientFactory.java b/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/utils/HttpClientFactory.java index 73f2c518..bfbe6ae2 100644 --- a/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/utils/HttpClientFactory.java +++ b/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/utils/HttpClientFactory.java @@ -200,11 +200,16 @@ public class HttpClientFactory implements IHttpClientFactory { //set pool connection if required injectConnectionPoolIfRequired(); - final ClientAuthMode clientAuthMode = ClientAuthMode.fromString( + ClientAuthMode clientAuthMode = ClientAuthMode.fromString( basicConfig.getBasicConfiguration(PROP_CONFIG_CLIENT_MODE, ClientAuthMode.NONE.getMode())); - log.info("Client authentication-mode is set to: {}", clientAuthMode); - + if (clientAuthMode == null) { + log.warn("Can Not parse ClientAuthMode! Set mode to default value"); + clientAuthMode = ClientAuthMode.NONE; + + } + //inject basic http authentication if required + log.info("Client authentication-mode is set to: {}", clientAuthMode); injectBasicAuthenticationIfRequired(clientAuthMode); //inject authentication if required -- cgit v1.2.3