Prevent possible null pointer in netconf-connector's keepalives 63/22763/2
authorMaros Marsalek <mmarsale@cisco.com>
Tue, 16 Jun 2015 12:09:32 +0000 (14:09 +0200)
committerGerrit Code Review <gerrit@opendaylight.org>
Wed, 1 Jul 2015 14:41:54 +0000 (14:41 +0000)
Change-Id: If73a6eae2b11b3f4f3b37b0f5a022ebf5b9b18a8
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
(cherry picked from commit 5a4c31766fe1f8d3b600f1d4aa59b8407e90d100)

opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/sal/KeepaliveSalFacade.java

index 3537cd9..6c29f1d 100644 (file)
@@ -92,7 +92,9 @@ public final class KeepaliveSalFacade implements RemoteDeviceHandler<NetconfSess
      */
     private void resetKeepalive() {
         LOG.trace("{}: Resetting netconf keepalive timer", id);
-        currentKeepalive.cancel(false);
+        if(currentKeepalive != null) {
+            currentKeepalive.cancel(false);
+        }
         scheduleKeepalive();
     }
 

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.