Bump odlparent to 5.0.0
[netconf.git] / netconf / sal-netconf-connector / src / main / java / org / opendaylight / netconf / sal / connect / netconf / sal / KeepaliveSalFacade.java
index 7334f7c167955159fb24476e7679fc5305fe2a5a..825cd380996b90a61ad7cb9e01e9b87b6b78ff29 100644 (file)
@@ -215,9 +215,15 @@ public final class KeepaliveSalFacade implements RemoteDeviceHandler<NetconfSess
         public void onSuccess(final DOMRpcResult result) {
             // No matter what response we got, rpc-reply or rpc-error,
             // we got it from device so the netconf session is OK
-            if (result != null && result.getResult() != null) {
+            if (result == null) {
+                LOG.warn("{} Keepalive RPC returned null with response. Reconnecting netconf session", id);
+                reconnect();
+                return;
+            }
+
+            if (result.getResult() != null) {
                 lastKeepAliveSucceeded.set(true);
-            }  else if (result != null && result.getErrors() != null) {
+            }  else if (result.getErrors() != null) {
                 LOG.warn("{}: Keepalive RPC failed with error: {}", id, result.getErrors());
                 lastKeepAliveSucceeded.set(true);
             } else {