This is an automated email from the ASF dual-hosted git repository.

jiajunwang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/helix.git


The following commit(s) were added to refs/heads/master by this push:
     new 3d352c3  Check server field state before shutdown to avoid NPE in 
MockMetadataStoreDirectoryServer. (#1847)
3d352c3 is described below

commit 3d352c34a5f9e563a10a3a8c7ce5e541fcbeb25d
Author: Jiajun Wang <[email protected]>
AuthorDate: Mon Aug 23 16:04:20 2021 -0700

    Check server field state before shutdown to avoid NPE in 
MockMetadataStoreDirectoryServer. (#1847)
    
    Check server field state before shutdown to avoid NPE in 
MockMetadataStoreDirectoryServer.
---
 .../apache/helix/msdcommon/mock/MockMetadataStoreDirectoryServer.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/metadata-store-directory-common/src/main/java/org/apache/helix/msdcommon/mock/MockMetadataStoreDirectoryServer.java
 
b/metadata-store-directory-common/src/main/java/org/apache/helix/msdcommon/mock/MockMetadataStoreDirectoryServer.java
index 8684275..4ead0d7 100644
--- 
a/metadata-store-directory-common/src/main/java/org/apache/helix/msdcommon/mock/MockMetadataStoreDirectoryServer.java
+++ 
b/metadata-store-directory-common/src/main/java/org/apache/helix/msdcommon/mock/MockMetadataStoreDirectoryServer.java
@@ -103,7 +103,9 @@ public class MockMetadataStoreDirectoryServer {
   }
 
   public void stopServer() {
-    _server.stop(0);
+    if (_server != null) {
+      _server.stop(0);
+    }
     _executor.shutdown();
     LOG.info(
         "Stopped MockMetadataStoreDirectoryServer at " + _hostname + ":" + 
_mockServerPort + "!");

Reply via email to