Repository: knox
Updated Branches:
  refs/heads/master 5ecb51e3c -> 6e56ea05f


KNOX-1251 - Fix NPE in RemoteAliasService#stop()


Project: http://git-wip-us.apache.org/repos/asf/knox/repo
Commit: http://git-wip-us.apache.org/repos/asf/knox/commit/6e56ea05
Tree: http://git-wip-us.apache.org/repos/asf/knox/tree/6e56ea05
Diff: http://git-wip-us.apache.org/repos/asf/knox/diff/6e56ea05

Branch: refs/heads/master
Commit: 6e56ea05f2ce56bb610ad51f2fc7ae9b0aa9b66d
Parents: 5ecb51e
Author: Sandeep More <[email protected]>
Authored: Tue Apr 17 19:15:17 2018 -0400
Committer: Sandeep More <[email protected]>
Committed: Tue Apr 17 19:15:17 2018 -0400

----------------------------------------------------------------------
 .../services/security/impl/RemoteAliasService.java       | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/knox/blob/6e56ea05/gateway-server/src/main/java/org/apache/knox/gateway/services/security/impl/RemoteAliasService.java
----------------------------------------------------------------------
diff --git 
a/gateway-server/src/main/java/org/apache/knox/gateway/services/security/impl/RemoteAliasService.java
 
b/gateway-server/src/main/java/org/apache/knox/gateway/services/security/impl/RemoteAliasService.java
index 2e287e0..9ba5d0b 100644
--- 
a/gateway-server/src/main/java/org/apache/knox/gateway/services/security/impl/RemoteAliasService.java
+++ 
b/gateway-server/src/main/java/org/apache/knox/gateway/services/security/impl/RemoteAliasService.java
@@ -476,11 +476,12 @@ public class RemoteAliasService implements AliasService {
 
   @Override
   public void stop() throws ServiceLifecycleException {
-    try {
-      remoteClient.removeEntryListener(PATH_KNOX_ALIAS_STORE_TOPOLOGY);
-    } catch (final Exception e) {
-      LOG.errorRemovingRemoteListener(PATH_KNOX_ALIAS_STORE_TOPOLOGY,
-          e.toString());
+    if(remoteClient != null) {
+      try {
+        remoteClient.removeEntryListener(PATH_KNOX_ALIAS_STORE_TOPOLOGY);
+      } catch (final Exception e) {
+        LOG.errorRemovingRemoteListener(PATH_KNOX_ALIAS_STORE_TOPOLOGY, 
e.toString());
+      }
     }
   }
 

Reply via email to