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:01:35 UTC

[iotdb] branch master updated: Fix possible npe when closing IdentitySinkOperator

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

jackietien 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 dc016d8368 Fix possible npe when closing IdentitySinkOperator
dc016d8368 is described below

commit dc016d83688b0d5c5aebd41f2668987671af0f85
Author: Liao Lanyu <14...@qq.com>
AuthorDate: Mon Mar 20 14:01:29 2023 +0800

    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();
+      }
     }
   }