Fix close() in provider 70/46470/2
authorJakub Toth <jatoth@cisco.com>
Tue, 4 Oct 2016 12:02:06 +0000 (14:02 +0200)
committerJakub Toth <jatoth@cisco.com>
Tue, 4 Oct 2016 12:03:50 +0000 (12:03 +0000)
 *added condition on get() from handler

Change-Id: I45c89c44585dc1e5e3ae685eba8d6033ea2e171f
Signed-off-by: Jakub Toth <jatoth@cisco.com>
restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/RestConnectorProvider.java

index 418c9333e2e01ec853ae45e393b9e88e52891459..cc14b7f332ad611bb0ea1bb96eefdeea4881ec3f 100644 (file)
@@ -113,8 +113,8 @@ public class RestConnectorProvider implements Provider, RestConnector, AutoClose
         }
 
         // close transaction chain
-        if (RestConnectorProvider.transactionChainHandler != null) {
-            RestConnectorProvider.transactionChainHandler.get().close();
+        if ((transactionChainHandler != null) && (transactionChainHandler.get() != null)) {
+            transactionChainHandler.get().close();
         }
     }
 }