Index: chrome/renderer/pepper/pepper_uma_host.cc |
diff --git a/chrome/renderer/pepper/pepper_uma_host.cc b/chrome/renderer/pepper/pepper_uma_host.cc |
index ca9edc4bae5ce28ac1a7e88605ee270bfb56d102..7ecdcf9f3bac90204d0f52628ac945e1e5ff554c 100644 |
--- a/chrome/renderer/pepper/pepper_uma_host.cc |
+++ b/chrome/renderer/pepper/pepper_uma_host.cc |
@@ -112,7 +112,10 @@ int32_t PepperUMAHost::OnHistogramCustomTimes( |
base::TimeDelta::FromMilliseconds(max), |
bucket_count, |
base::HistogramBase::kUmaTargetedHistogramFlag); |
- counter->AddTime(base::TimeDelta::FromMilliseconds(sample)); |
+ // The histogram can be NULL if it is constructed with bad arguments. Ignore |
+ // that data for this API. An error message will be logged. |
+ if (counter) |
+ counter->AddTime(base::TimeDelta::FromMilliseconds(sample)); |
return PP_OK; |
} |
@@ -135,7 +138,10 @@ int32_t PepperUMAHost::OnHistogramCustomCounts( |
max, |
bucket_count, |
base::HistogramBase::kUmaTargetedHistogramFlag); |
- counter->Add(sample); |
+ // The histogram can be NULL if it is constructed with bad arguments. Ignore |
+ // that data for this API. An error message will be logged. |
+ if (counter) |
+ counter->Add(sample); |
return PP_OK; |
} |
@@ -156,7 +162,10 @@ int32_t PepperUMAHost::OnHistogramEnumeration( |
boundary_value, |
boundary_value + 1, |
base::HistogramBase::kUmaTargetedHistogramFlag); |
- counter->Add(sample); |
+ // The histogram can be NULL if it is constructed with bad arguments. Ignore |
+ // that data for this API. An error message will be logged. |
+ if (counter) |
+ counter->Add(sample); |
return PP_OK; |
} |