Repository: karaf-cellar
Updated Branches:
  refs/heads/cellar-4.0.x 598335cca -> 90d0066bf


[KARAF-4908] Prevent NPE in FeaturesSynchronizer


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

Branch: refs/heads/cellar-4.0.x
Commit: 90d0066bfda7711b74ace52c27161dd67096ba32
Parents: 598335c
Author: Jean-Baptiste Onofré <[email protected]>
Authored: Wed Apr 19 15:36:52 2017 +0200
Committer: Jean-Baptiste Onofré <[email protected]>
Committed: Wed Apr 19 15:37:19 2017 +0200

----------------------------------------------------------------------
 .../org/apache/karaf/cellar/features/FeaturesSynchronizer.java   | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/90d0066b/features/src/main/java/org/apache/karaf/cellar/features/FeaturesSynchronizer.java
----------------------------------------------------------------------
diff --git 
a/features/src/main/java/org/apache/karaf/cellar/features/FeaturesSynchronizer.java
 
b/features/src/main/java/org/apache/karaf/cellar/features/FeaturesSynchronizer.java
index 7524309..88abe5f 100644
--- 
a/features/src/main/java/org/apache/karaf/cellar/features/FeaturesSynchronizer.java
+++ 
b/features/src/main/java/org/apache/karaf/cellar/features/FeaturesSynchronizer.java
@@ -322,7 +322,9 @@ public class FeaturesSynchronizer extends FeaturesSupport 
implements Synchronize
             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 FEATURE: error while retrieving the sync 
policy", e);

Reply via email to