[Issue 7407] NPE with tombstones
Added check to prevent NPE when a tombstone (null value) is produced.
Fixes
@@ -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);
}
}
