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

Unified Diff: chrome/browser/extensions/app_sync_bundle.cc

Issue 996213005: Don't crash when trying to create an ExtensionSyncData from invalid SyncData. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Created 5 years, 9 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: chrome/browser/extensions/app_sync_bundle.cc
diff --git a/chrome/browser/extensions/app_sync_bundle.cc b/chrome/browser/extensions/app_sync_bundle.cc
index 69a5db6c656b120274af25b1170fd2f5c73afb53..c50f2c9aa7361b503735c8954024a6ae07080af5 100644
--- a/chrome/browser/extensions/app_sync_bundle.cc
+++ b/chrome/browser/extensions/app_sync_bundle.cc
@@ -33,9 +33,11 @@ void AppSyncBundle::SetupSync(
for (syncer::SyncDataList::const_iterator i = initial_sync_data.begin();
i != initial_sync_data.end();
++i) {
- AppSyncData app_sync_data(*i);
- AddApp(app_sync_data.id());
- extension_sync_service_->ProcessAppSyncData(app_sync_data);
+ scoped_ptr<AppSyncData> app_sync_data(AppSyncData::CreateFromSyncData(*i));
+ if (app_sync_data.get()) {
not at google - send to devlin 2015/03/11 23:21:34 FYI .get() not needed, but leave it this way or do
Yoyo Zhou 2015/03/12 00:25:48 I'll leave it, I think.
+ AddApp(app_sync_data->id());
+ extension_sync_service_->ProcessAppSyncData(*app_sync_data);
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698