Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(355)

Unified Diff: components/policy/core/common/cloud/component_cloud_policy_store.cc

Issue 2706293005: Fix DCHECK hit on component policy fetch with empty ID (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/policy/core/common/cloud/component_cloud_policy_store_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/policy/core/common/cloud/component_cloud_policy_store.cc
diff --git a/components/policy/core/common/cloud/component_cloud_policy_store.cc b/components/policy/core/common/cloud/component_cloud_policy_store.cc
index 93617d8d7e983affad3de065024a0e407013ca0f..29c8dd418b8fc9c4f12b11ca9cfc628cb8f134f6 100644
--- a/components/policy/core/common/cloud/component_cloud_policy_store.cc
+++ b/components/policy/core/common/cloud/component_cloud_policy_store.cc
@@ -289,6 +289,10 @@ bool ComponentCloudPolicyStore::ValidatePolicy(
LOG(ERROR) << "Bad policy type";
return false;
}
+ if (ns.component_id.empty()) {
+ LOG(ERROR) << "Empty component id";
+ return false;
+ }
if (username_.empty() || dm_token_.empty() || device_id_.empty() ||
public_key_.empty() || public_key_version_ == -1) {
« no previous file with comments | « no previous file | components/policy/core/common/cloud/component_cloud_policy_store_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698