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

caogaofei pushed a commit to branch beyyes/1.0_fixbug
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/beyyes/1.0_fixbug by this push:
     new 828aff0621 add npe check
828aff0621 is described below

commit 828aff0621f00dec74c1fe353b44830dcc9325bd
Author: Beyyes <[email protected]>
AuthorDate: Thu Dec 1 18:38:56 2022 +0800

    add npe check
---
 .../src/main/java/org/apache/iotdb/confignode/service/ConfigNode.java | 4 ++++
 1 file changed, 4 insertions(+)

diff --git 
a/confignode/src/main/java/org/apache/iotdb/confignode/service/ConfigNode.java 
b/confignode/src/main/java/org/apache/iotdb/confignode/service/ConfigNode.java
index 5954a66221..a061d6c313 100644
--- 
a/confignode/src/main/java/org/apache/iotdb/confignode/service/ConfigNode.java
+++ 
b/confignode/src/main/java/org/apache/iotdb/confignode/service/ConfigNode.java
@@ -259,6 +259,10 @@ public class ConfigNode implements ConfigNodeMBean {
       }
 
       if (status.getCode() == TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
+        if (resp == null) {
+          LOGGER.error("The result of register ConfigNode is empty!");
+          throw new StartupException("The result of register ConfigNode is 
empty!");
+        }
         /* Always set ConfigNodeId before initConsensusManager */
         CONF.setConfigNodeId(resp.getConfigNodeId());
         configManager.initConsensusManager();

Reply via email to