You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by si...@apache.org on 2020/07/06 01:27:04 UTC

[pulsar] branch master updated: [Issue 7407] NPE with tombstones (#7408)

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

sijie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new 90c2f4a  [Issue 7407] NPE with tombstones (#7408)
90c2f4a is described below

commit 90c2f4ae8bb8fa405e69f0b2cf99622223bae6ab
Author: Fernando Miguélez Palomo <fe...@gmail.com>
AuthorDate: Mon Jul 6 03:26:47 2020 +0200

    [Issue 7407] NPE with tombstones (#7408)
    
    Added check to prevent NPE when a tombstone (null value) is produced.
    
    Fixes #7407
---
 .../java/org/apache/pulsar/client/impl/ConsumerStatsRecorderImpl.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerStatsRecorderImpl.java b/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerStatsRecorderImpl.java
index 80ee5f9..c1a2559 100644
--- a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerStatsRecorderImpl.java
+++ b/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerStatsRecorderImpl.java
@@ -166,7 +166,7 @@ public class ConsumerStatsRecorderImpl implements ConsumerStatsRecorder {
     public void updateNumMsgsReceived(Message<?> message) {
         if (message != null) {
             numMsgsReceived.increment();
-            numBytesReceived.add(message.getData().length);
+            numBytesReceived.add(message.getData() == null ? 0 : message.getData().length);
         }
     }