Commit 087bb2cc authored by Tarun Bansal's avatar Tarun Bansal Committed by Commit Bot

Fix the null crash in the network quality estimator

Check if the histogram is null before adding an entry to it.

Bug: 776579
Change-Id: I77049905fa5953cdf52d5438fa7ea15385877898
Reviewed-on: https://chromium-review.googlesource.com/806879Reviewed-by: default avatarRyan Sturm <ryansturm@chromium.org>
Commit-Queue: Tarun Bansal <tbansal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521482}
parent 30975340
......@@ -1739,7 +1739,8 @@ void NetworkQualityEstimator::AddAndNotifyObserversOfRTT(
std::string("NQE.RTT.RawObservation.") +
nqe::internal::GetNameForObservationSource(observation.source()),
1, 10 * 1000, 50, base::HistogramBase::kUmaTargetedHistogramFlag);
raw_observation_histogram->Add(observation.value());
if (raw_observation_histogram)
raw_observation_histogram->Add(observation.value());
// Maybe recompute the effective connection type since a new RTT observation
// is available.
......@@ -1773,7 +1774,8 @@ void NetworkQualityEstimator::AddAndNotifyObserversOfThroughput(
std::string("NQE.Kbps.RawObservation.") +
nqe::internal::GetNameForObservationSource(observation.source()),
1, 10 * 1000, 50, base::HistogramBase::kUmaTargetedHistogramFlag);
raw_observation_histogram->Add(observation.value());
if (raw_observation_histogram)
raw_observation_histogram->Add(observation.value());
// Maybe recompute the effective connection type since a new throughput
// observation is available.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment