A little extra protection against nulls in ConfigPusher 29/9729/1
authorEd Warnicke <eaw@cisco.com>
Wed, 6 Aug 2014 04:24:02 +0000 (23:24 -0500)
committerEd Warnicke <eaw@cisco.com>
Wed, 6 Aug 2014 04:27:59 +0000 (23:27 -0500)
Change-Id: I4aab592b028b8336370c23924fcbf69858b7a6bd
Signed-off-by: Ed Warnicke <eaw@cisco.com>
opendaylight/netconf/config-persister-impl/src/main/java/org/opendaylight/controller/netconf/persist/impl/ConfigPusher.java

index eddad8b4c7c1df593c45a5f829c3c56828339e18..fff8d611b7975b34dce89ce603f164603ea2b582 100644 (file)
@@ -65,9 +65,11 @@ public class ConfigPusher {
         LinkedHashMap<ConfigSnapshotHolder, EditAndCommitResponse> result = new LinkedHashMap<>();
         // start pushing snapshots:
         for (ConfigSnapshotHolder configSnapshotHolder : configs) {
         LinkedHashMap<ConfigSnapshotHolder, EditAndCommitResponse> result = new LinkedHashMap<>();
         // start pushing snapshots:
         for (ConfigSnapshotHolder configSnapshotHolder : configs) {
-            EditAndCommitResponse editAndCommitResponseWithRetries = pushConfigWithConflictingVersionRetries(configSnapshotHolder);
-            logger.debug("Config snapshot pushed successfully: {}, result: {}", configSnapshotHolder, result);
-            result.put(configSnapshotHolder, editAndCommitResponseWithRetries);
+            if(configSnapshotHolder != null) {
+                EditAndCommitResponse editAndCommitResponseWithRetries = pushConfigWithConflictingVersionRetries(configSnapshotHolder);
+                logger.debug("Config snapshot pushed successfully: {}, result: {}", configSnapshotHolder, result);
+                result.put(configSnapshotHolder, editAndCommitResponseWithRetries);
+            }
         }
         logger.debug("All configuration snapshots have been pushed successfully.");
         return result;
         }
         logger.debug("All configuration snapshots have been pushed successfully.");
         return result;