You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by jb...@apache.org on 2020/12/14 12:43:33 UTC

[karaf] branch master updated: [KARAF-6949] Avoid potential NPE in HTTP ProxyServiceImpl

This is an automated email from the ASF dual-hosted git repository.

jbonofre pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/karaf.git


The following commit(s) were added to refs/heads/master by this push:
     new 057e121  [KARAF-6949] Avoid potential NPE in HTTP ProxyServiceImpl
     new ea18d6f  Merge pull request #1264 from jbonofre/KARAF-6949
057e121 is described below

commit 057e121986360b16c864421c0a9fc6462654abf2
Author: jbonofre <jb...@apache.org>
AuthorDate: Mon Dec 14 08:05:22 2020 +0100

    [KARAF-6949] Avoid potential NPE in HTTP ProxyServiceImpl
---
 .../java/org/apache/karaf/http/core/internal/ProxyServiceImpl.java  | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/http/src/main/java/org/apache/karaf/http/core/internal/ProxyServiceImpl.java b/http/src/main/java/org/apache/karaf/http/core/internal/ProxyServiceImpl.java
index 4163ec8..5e86fcf 100644
--- a/http/src/main/java/org/apache/karaf/http/core/internal/ProxyServiceImpl.java
+++ b/http/src/main/java/org/apache/karaf/http/core/internal/ProxyServiceImpl.java
@@ -48,8 +48,10 @@ public class ProxyServiceImpl implements ProxyService {
         this.bundleContext = bundleContext;
         this.proxies = new HashMap<>();
         try {
-            Configuration configuration = configurationAdmin.getConfiguration(CONFIGURATION_PID);
-            update(configuration.getProcessedProperties(null));
+            Configuration configuration = configurationAdmin.getConfiguration(CONFIGURATION_PID, null);
+            if (configuration != null) {
+                update(configuration.getProcessedProperties(null));
+            }
         } catch (Exception e) {
             LOG.error("Can't load proxies", e);
         }