Repository: karaf-cellar Updated Branches: refs/heads/cellar-4.0.x dee78861b -> 598335cca
[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/598335cc Tree: http://git-wip-us.apache.org/repos/asf/karaf-cellar/tree/598335cc Diff: http://git-wip-us.apache.org/repos/asf/karaf-cellar/diff/598335cc Branch: refs/heads/cellar-4.0.x Commit: 598335ccaad1c48ce93b951920eb0d99e50bf13f Parents: dee7886 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:44 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/598335cc/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);
