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 2022/02/10 08:14:09 UTC

[iotdb] branch IOTDB-2526 created (now 8c9f43b)

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

jackietien pushed a change to branch IOTDB-2526
in repository https://gitbox.apache.org/repos/asf/iotdb.git.


      at 8c9f43b  [IOTDB-2526] Fix NPE when setting meta_data_cache_enable=false

This branch includes the following new commits:

     new 8c9f43b  [IOTDB-2526] Fix NPE when setting meta_data_cache_enable=false

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[iotdb] 01/01: [IOTDB-2526] Fix NPE when setting meta_data_cache_enable=false

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch IOTDB-2526
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 8c9f43bb591ff9208a903d2576fa6c6cf96398a3
Author: JackieTien97 <ja...@gmail.com>
AuthorDate: Thu Feb 10 16:13:04 2022 +0800

    [IOTDB-2526] Fix NPE when setting meta_data_cache_enable=false
---
 .../org/apache/iotdb/db/engine/cache/TimeSeriesMetadataCache.java     | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/engine/cache/TimeSeriesMetadataCache.java b/server/src/main/java/org/apache/iotdb/db/engine/cache/TimeSeriesMetadataCache.java
index 63d2f56..7b4a51c 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/cache/TimeSeriesMetadataCache.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/cache/TimeSeriesMetadataCache.java
@@ -157,7 +157,9 @@ public class TimeSeriesMetadataCache {
       }
       TimeseriesMetadata timeseriesMetadata =
           reader.readTimeseriesMetadata(new Path(key.device, key.measurement), false);
-      return timeseriesMetadata.getStatistics().getCount() == 0 ? null : timeseriesMetadata;
+      return (timeseriesMetadata == null || timeseriesMetadata.getStatistics().getCount() == 0)
+          ? null
+          : timeseriesMetadata;
     }
 
     TimeseriesMetadata timeseriesMetadata = lruCache.getIfPresent(key);