Skip to content

Commit

Permalink
Fix issue 5505 (#6060)
Browse files Browse the repository at this point in the history
  • Loading branch information
ntysdd authored and Masahiro Sakamoto committed Jan 23, 2020
1 parent 992fc1e commit 56280ea
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,12 @@ public TopicStats add(TopicStats stats) {
}
} else {
for (String subscription : stats.subscriptions.keySet()) {
this.subscriptions.get(subscription).add(stats.subscriptions.get(subscription));
if (this.subscriptions.get(subscription) != null) {
this.subscriptions.get(subscription).add(stats.subscriptions.get(subscription));
} else {
SubscriptionStats subscriptionStats = new SubscriptionStats();
this.subscriptions.put(subscription, subscriptionStats.add(stats.subscriptions.get(subscription)));
}
}
}
if (this.replication.size() != stats.replication.size()) {
Expand All @@ -131,7 +136,12 @@ public TopicStats add(TopicStats stats) {
}
} else {
for (String repl : stats.replication.keySet()) {
this.replication.get(repl).add(stats.replication.get(repl));
if (this.replication.get(repl) != null) {
this.replication.get(repl).add(stats.replication.get(repl));
} else {
ReplicatorStats replStats = new ReplicatorStats();
this.replication.put(repl, replStats.add(stats.replication.get(repl)));
}
}
}
return this;
Expand Down

0 comments on commit 56280ea

Please sign in to comment.