Capture server key before returning from callback
[netconf.git] / netconf / callhome-provider / src / main / java / org / opendaylight / netconf / callhome / mount / CallhomeStatusReporter.java
index 1f819ae0a34ffa3f0cf5a32597ed9c72d1be6c86..7bff5acd4a661b7c8b02ad07e83a5b8b18ef279b 100644 (file)
@@ -303,6 +303,10 @@ class CallhomeStatusReporter implements DataTreeChangeListener<Node>, StatusReco
 
         for (Device device : getDevicesAsList()) {
             String keyString = device.getSshHostKey();
+            if (keyString == null) {
+                LOG.info("Whitelist device {} does not have a host key, skipping it", device.getUniqueId());
+                continue;
+            }
 
             try {
                 PublicKey pubKey = decoder.decodePublicKey(keyString);