You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ja...@apache.org on 2023/03/20 06:09:04 UTC

[iotdb] branch rel/1.1 updated: [To rel/1.1] Fix possible npe when closing IdentitySinkOperator

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

jackietien pushed a commit to branch rel/1.1
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/rel/1.1 by this push:
     new 1f605d5ba1 [To rel/1.1] Fix possible npe when closing IdentitySinkOperator
1f605d5ba1 is described below

commit 1f605d5ba1e86c090ea6d351d100124a6cfcf7f2
Author: Liao Lanyu <14...@qq.com>
AuthorDate: Mon Mar 20 14:08:57 2023 +0800

    [To rel/1.1] Fix possible npe when closing IdentitySinkOperator
---
 .../iotdb/db/mpp/execution/operator/sink/IdentitySinkOperator.java | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/sink/IdentitySinkOperator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/sink/IdentitySinkOperator.java
index e4b44508d5..80ac16af92 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/sink/IdentitySinkOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/sink/IdentitySinkOperator.java
@@ -26,7 +26,6 @@ import org.apache.iotdb.db.mpp.execution.operator.OperatorContext;
 import org.apache.iotdb.tsfile.read.common.block.TsBlock;
 
 import com.google.common.util.concurrent.ListenableFuture;
-import org.apache.commons.lang3.Validate;
 
 import java.util.List;
 
@@ -118,8 +117,10 @@ public class IdentitySinkOperator implements Operator {
   @Override
   public void close() throws Exception {
     for (int i = downStreamChannelIndex.getCurrentIndex(), n = children.size(); i < n; i++) {
-      Validate.notNull(children.get(i));
-      children.get(i).close();
+      Operator currentChild = children.get(i);
+      if (currentChild != null) {
+        currentChild.close();
+      }
     }
   }