Skip to content

Commit

Permalink
Add null check to prevent initialization NPE for byteOutMetric in Psc…
Browse files Browse the repository at this point in the history
…Writer
  • Loading branch information
jeffxiang committed Oct 30, 2024
1 parent 11feb61 commit 8be3077
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,9 @@ private void registerMetricSync() {
if (closed) {
return;
}
if (byteOutMetric == null || byteOutMetric.metricValue() == null) {
return;
}
long outgoingBytesUntilNow = ((Number) byteOutMetric.metricValue()).longValue();
long outgoingBytesSinceLastUpdate =
outgoingBytesUntilNow - latestOutgoingByteTotal;
Expand Down

0 comments on commit 8be3077

Please sign in to comment.