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

Unified Diff: components/autofill/core/browser/webdata/autocomplete_sync_bridge.cc

Issue 2867143002: [sync] Check against nullptr web_data_backend->GetDatabase() (Closed)
Patch Set: rebase Created 3 years, 7 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
Index: components/autofill/core/browser/webdata/autocomplete_sync_bridge.cc
diff --git a/components/autofill/core/browser/webdata/autocomplete_sync_bridge.cc b/components/autofill/core/browser/webdata/autocomplete_sync_bridge.cc
index df12ab1add44935e2791a2fd862e767b7672585b..21653cc12c016b66b10699f61f4862c71380e064 100644
--- a/components/autofill/core/browser/webdata/autocomplete_sync_bridge.cc
+++ b/components/autofill/core/browser/webdata/autocomplete_sync_bridge.cc
@@ -449,6 +449,13 @@ void AutocompleteSyncBridge::ActOnLocalChanges(
void AutocompleteSyncBridge::LoadMetadata() {
auto batch = base::MakeUnique<syncer::MetadataBatch>();
skym 2017/05/08 22:22:13 Why make the batch first?
Patrick Noland 2017/05/08 22:36:33 Done.
+ if (!web_data_backend_ || !web_data_backend_->GetDatabase() ||
+ !GetAutofillTable()) {
+ change_processor()->ReportError(FROM_HERE,
+ "Failed to load AutofillWebDatabase.");
+ return;
+ }
+
if (!GetAutofillTable()->GetAllSyncMetadata(syncer::AUTOFILL, batch.get())) {
change_processor()->ReportError(
FROM_HERE, "Failed reading autofill metadata from WebDatabase.");

Powered by Google App Engine
This is Rietveld 408576698