Merge "metricsd: Add more assert clause."
diff --git a/metricsd/uploader/metrics_log.cc b/metricsd/uploader/metrics_log.cc
index 39655e6..fcaa8c1 100644
--- a/metricsd/uploader/metrics_log.cc
+++ b/metricsd/uploader/metrics_log.cc
@@ -85,5 +85,6 @@
}
bool MetricsLog::PopulateSystemProfile(SystemProfileSetter* profile_setter) {
+ CHECK(profile_setter);
return profile_setter->Populate(uma_proto());
}
diff --git a/metricsd/uploader/system_profile_cache.cc b/metricsd/uploader/system_profile_cache.cc
index 70f6afd..e6f6617 100644
--- a/metricsd/uploader/system_profile_cache.cc
+++ b/metricsd/uploader/system_profile_cache.cc
@@ -80,6 +80,10 @@
} else {
reader.Load();
auto client = update_engine::UpdateEngineClient::CreateInstance();
+ if (!client) {
+ LOG(ERROR) << "failed to create the update engine client";
+ return false;
+ }
if (!client->GetChannel(&channel)) {
LOG(ERROR) << "failed to read the current channel from update engine.";
return false;