You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by sp...@apache.org on 2023/07/04 15:16:33 UTC

[iotdb] branch fix/metric_invalid_npe_1.2 created (now a3fc426e5b2)

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

spricoder pushed a change to branch fix/metric_invalid_npe_1.2
in repository https://gitbox.apache.org/repos/asf/iotdb.git


      at a3fc426e5b2 Fix NPE Exception

This branch includes the following new commits:

     new a3fc426e5b2 Fix NPE Exception

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: Fix NPE Exception

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

spricoder pushed a commit to branch fix/metric_invalid_npe_1.2
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit a3fc426e5b217a4444f43d2933b120a623d06b41
Author: spricoder <sp...@qq.com>
AuthorDate: Tue Jul 4 23:14:13 2023 +0800

    Fix NPE Exception
---
 .../src/main/java/org/apache/iotdb/metrics/AbstractMetricManager.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/metrics/interface/src/main/java/org/apache/iotdb/metrics/AbstractMetricManager.java b/metrics/interface/src/main/java/org/apache/iotdb/metrics/AbstractMetricManager.java
index e077598ba30..1273605c8d4 100644
--- a/metrics/interface/src/main/java/org/apache/iotdb/metrics/AbstractMetricManager.java
+++ b/metrics/interface/src/main/java/org/apache/iotdb/metrics/AbstractMetricManager.java
@@ -446,10 +446,10 @@ public abstract class AbstractMetricManager {
     if (!isEnableMetricInGivenLevel(metricLevel)) {
       return true;
     }
-    if (!nameToMetaInfo.containsKey(name)) {
+    MetricInfo.MetaInfo metaInfo = nameToMetaInfo.get(name);
+    if (metaInfo == null) {
       return false;
     }
-    MetricInfo.MetaInfo metaInfo = nameToMetaInfo.get(name);
     return !metaInfo.hasSameKey(tags);
   }