You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ha...@apache.org on 2022/07/19 01:13:30 UTC

[iotdb] branch master updated: [IOTDB-3877] Fix DataNodeInternalRPCServiceImplTest NullPointerException (#6703)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 07b598f642 [IOTDB-3877] Fix DataNodeInternalRPCServiceImplTest NullPointerException (#6703)
07b598f642 is described below

commit 07b598f64205582cc7a2ed205240f174af1c53fb
Author: QiangShaowei <ba...@163.com>
AuthorDate: Tue Jul 19 09:13:25 2022 +0800

    [IOTDB-3877] Fix DataNodeInternalRPCServiceImplTest NullPointerException (#6703)
---
 .../java/org/apache/iotdb/db/utils/EnvironmentUtils.java     | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/server/src/test/java/org/apache/iotdb/db/utils/EnvironmentUtils.java b/server/src/test/java/org/apache/iotdb/db/utils/EnvironmentUtils.java
index bc698434dd..104ec29bee 100644
--- a/server/src/test/java/org/apache/iotdb/db/utils/EnvironmentUtils.java
+++ b/server/src/test/java/org/apache/iotdb/db/utils/EnvironmentUtils.java
@@ -104,9 +104,15 @@ public class EnvironmentUtils {
 
     // deregister all user defined classes
     try {
-      UDFRegistrationService.getInstance().deregisterAll();
-      TriggerRegistrationService.getInstance().deregisterAll();
-      ContinuousQueryService.getInstance().deregisterAll();
+      if (UDFRegistrationService.getInstance() != null) {
+        UDFRegistrationService.getInstance().deregisterAll();
+      }
+      if (TriggerRegistrationService.getInstance() != null) {
+        TriggerRegistrationService.getInstance().deregisterAll();
+      }
+      if (ContinuousQueryService.getInstance() != null) {
+        ContinuousQueryService.getInstance().deregisterAll();
+      }
     } catch (UDFRegistrationException | TriggerManagementException | ContinuousQueryException e) {
       fail(e.getMessage());
     }