Skip to content

Commit

Permalink
Fix crash in structured metrics service
Browse files Browse the repository at this point in the history
(cherry picked from commit 4fce644)

Bug: crbug.com/1450438
Change-Id: I804222a484aa4a7216b667deaeca4a9f39067020
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4585001
Commit-Queue: Andrew Bregger <andrewbregger@google.com>
Reviewed-by: Jong Ahn <jongahn@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#1152789}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4598096
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/branch-heads/5790@{#460}
Cr-Branched-From: 1d71a33-refs/heads/main@{#1148114}
  • Loading branch information
Andrew Bregger authored and Chromium LUCI CQ committed Jun 7, 2023
1 parent 508b22e commit b75a827
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion components/metrics/structured/structured_metrics_service.cc
Expand Up @@ -123,7 +123,11 @@ base::TimeDelta StructuredMetricsService::GetUploadTimeInterval() {

void StructuredMetricsService::RotateLogsAndSend() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
if (recorder_->events()->non_uma_events_size() == 0) {

// Verify that the recorder has been initialized and can be providing metrics.
// And if it is, then see if there are any events ready to be uploaded.
if (!recorder_->can_provide_metrics() ||
recorder_->events()->non_uma_events_size() == 0) {
return;
}

Expand Down

0 comments on commit b75a827

Please sign in to comment.