diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/thrift/impl/ClientRPCServiceImpl.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/thrift/impl/ClientRPCServiceImpl.java index 2ae50d3605718..f8bd094b69ee4 100644 --- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/thrift/impl/ClientRPCServiceImpl.java +++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/thrift/impl/ClientRPCServiceImpl.java @@ -1008,7 +1008,8 @@ public TSExecuteStatementResp executeFastLastDataQueryForOneDeviceV2( if (timeValuePair == null) { allCached = false; break; - } else if (timeValuePair.getValue() == null) { + } else if (timeValuePair == DeviceLastCache.EMPTY_TIME_VALUE_PAIR + || timeValuePair.getValue() == null) { // there is no data for this sensor if (!canUseNullEntry) { allCached = false;