Fix AbstractCommonSubscriber close method 41/76541/2
authorJakub Morvay <jmorvay@frinx.io>
Mon, 1 Oct 2018 18:10:29 +0000 (20:10 +0200)
committerJakub Morvay <jakub.morvay@gmail.com>
Mon, 1 Oct 2018 18:15:41 +0000 (18:15 +0000)
Check for null registration before trying to close it.

JIRA: NETCONF-565
Change-Id: I23861ce7c1857c00334ca40fac91389200368fed
Signed-off-by: Jakub Morvay <jmorvay@frinx.io>
restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/streams/listeners/AbstractCommonSubscriber.java

index 41503253bc61bb2f75fe07f0ea0ae10b6dfbc94d..2a7ba619c59a543fcedd6815912b458977396941 100644 (file)
@@ -51,8 +51,11 @@ abstract class AbstractCommonSubscriber extends AbstractQueryParams implements B
 
     @Override
     public final void close() {
-        this.registration.close();
-        this.registration = null;
+        if (registration != null) {
+            this.registration.close();
+            this.registration = null;
+        }
+
         unregister();
     }