Repository: karaf-cellar
Updated Branches:
  refs/heads/master c94a79ef6 -> ef1691907


[KARAF-4911] Prevent NPE in ConfigurationSynchronizer


Project: http://git-wip-us.apache.org/repos/asf/karaf-cellar/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf-cellar/commit/ef169190
Tree: http://git-wip-us.apache.org/repos/asf/karaf-cellar/tree/ef169190
Diff: http://git-wip-us.apache.org/repos/asf/karaf-cellar/diff/ef169190

Branch: refs/heads/master
Commit: ef1691907e6b5f01acce889ed13ed6a9ceafe2fc
Parents: c94a79e
Author: Jean-Baptiste Onofré <[email protected]>
Authored: Wed Apr 19 15:35:12 2017 +0200
Committer: Jean-Baptiste Onofré <[email protected]>
Committed: Wed Apr 19 15:35:12 2017 +0200

----------------------------------------------------------------------
 .../apache/karaf/cellar/config/ConfigurationSynchronizer.java    | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/ef169190/config/src/main/java/org/apache/karaf/cellar/config/ConfigurationSynchronizer.java
----------------------------------------------------------------------
diff --git 
a/config/src/main/java/org/apache/karaf/cellar/config/ConfigurationSynchronizer.java
 
b/config/src/main/java/org/apache/karaf/cellar/config/ConfigurationSynchronizer.java
index 8931cb0..7c7fe7c 100644
--- 
a/config/src/main/java/org/apache/karaf/cellar/config/ConfigurationSynchronizer.java
+++ 
b/config/src/main/java/org/apache/karaf/cellar/config/ConfigurationSynchronizer.java
@@ -266,7 +266,9 @@ public class ConfigurationSynchronizer extends 
ConfigurationSupport implements S
             Dictionary<String, Object> properties = 
configuration.getProperties();
             if (properties != null) {
                 String propertyKey = groupName + Configurations.SEPARATOR + 
Constants.CATEGORY + Configurations.SEPARATOR + Configurations.SYNC;
-                return properties.get(propertyKey).toString();
+                if (properties.get(propertyKey) != null) {
+                    return properties.get(propertyKey).toString();
+                }
             }
         } catch (IOException e) {
             LOGGER.error("CELLAR CONFIG: error while retrieving the sync 
policy", e);

Reply via email to