Skip to content

Commit

Permalink
[ISSUE apache#6627] Fix ConsumerLagCalculator#getAvailableMsgCount NP…
Browse files Browse the repository at this point in the history
…E if group or topic is null
  • Loading branch information
lizhimins committed Apr 23, 2023
1 parent af6a95f commit df699ff
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,10 @@ public Pair<Long, Long> getInFlightMsgStats(String group, String topic, int queu
public long getAvailableMsgCount(String group, String topic, boolean isPop) {
long total = 0L;

if (group == null || topic == null) {
return total;
}

TopicConfig topicConfig = topicConfigManager.selectTopicConfig(topic);
if (topicConfig != null) {
for (int queueId = 0; queueId < topicConfig.getWriteQueueNums(); queueId++) {
Expand Down

0 comments on commit df699ff

Please sign in to comment.