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

Unified Diff: chrome/browser/sync/internal_api/write_node.cc

Issue 7970018: sync: we can't lookup empty client tag nodes, so don't allow creating them (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 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 | « chrome/browser/sync/internal_api/syncapi_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/internal_api/write_node.cc
diff --git a/chrome/browser/sync/internal_api/write_node.cc b/chrome/browser/sync/internal_api/write_node.cc
index 5dc7cc7adbc5881ce07b8d21ba2b0879eff7c228..3beeaf7a72eed287c4511568444e19871a6578c7 100644
--- a/chrome/browser/sync/internal_api/write_node.cc
+++ b/chrome/browser/sync/internal_api/write_node.cc
@@ -394,6 +394,10 @@ bool WriteNode::InitUniqueByCreation(syncable::ModelType model_type,
const BaseNode& parent,
const std::string& tag) {
DCHECK(!entry_) << "Init called twice";
+ if (tag.empty()) {
+ LOG(WARNING) << "InitUniqueByCreation failed due to empty tag.";
+ return false;
+ }
const std::string hash = GenerateSyncableHash(model_type, tag);
« no previous file with comments | « chrome/browser/sync/internal_api/syncapi_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698