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

jiangtian 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 a524def3c6f Pipe: Fixed the NPE of tree privilege check (#17006)
a524def3c6f is described below

commit a524def3c6fd57ea58a960fa9df1964f5ace1877
Author: Caideyipi <[email protected]>
AuthorDate: Mon Jan 12 10:34:32 2026 +0800

    Pipe: Fixed the NPE of tree privilege check (#17006)
    
    * null
    
    * add-test
---
 .../org/apache/iotdb/db/pipe/pattern/IoTDBTreePatternTest.java     | 1 +
 .../iotdb/commons/pipe/datastructure/pattern/IoTDBTreePattern.java | 7 ++++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git 
a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/pattern/IoTDBTreePatternTest.java
 
b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/pattern/IoTDBTreePatternTest.java
index 9cb68f89fdf..e2a7bc0a4b5 100644
--- 
a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/pattern/IoTDBTreePatternTest.java
+++ 
b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/pattern/IoTDBTreePatternTest.java
@@ -143,5 +143,6 @@ public class IoTDBTreePatternTest {
         System.exit(-1);
       }
     }
+    Assert.assertEquals(null, applyReversedIndexesOnList(filteredIndexes, 
null));
   }
 }
diff --git 
a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/datastructure/pattern/IoTDBTreePattern.java
 
b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/datastructure/pattern/IoTDBTreePattern.java
index 9e54c1087ac..2becc993968 100644
--- 
a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/datastructure/pattern/IoTDBTreePattern.java
+++ 
b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/datastructure/pattern/IoTDBTreePattern.java
@@ -31,6 +31,8 @@ import org.apache.iotdb.pipe.api.exception.PipeException;
 
 import org.apache.tsfile.file.metadata.IDeviceID;
 
+import javax.annotation.Nullable;
+
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
@@ -67,7 +69,10 @@ public class IoTDBTreePattern extends 
IoTDBTreePatternOperations {
   //////////////////////////// Tree Pattern Operations 
////////////////////////////
 
   public static <T> List<T> applyReversedIndexesOnList(
-      final List<Integer> filteredIndexes, final List<T> originalList) {
+      final List<Integer> filteredIndexes, final @Nullable List<T> 
originalList) {
+    if (Objects.isNull(originalList)) {
+      return null;
+    }
     // No need to sort, the caller guarantees that the filtered sequence == 
original sequence
     final List<T> filteredList = new ArrayList<>(originalList.size() - 
filteredIndexes.size());
     int filteredIndexPos = 0;

Reply via email to