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

Unified Diff: chrome/browser/importer/importer.cc

Issue 204051: Fix crash during import by checking for errors and exiting early. (Closed)
Patch Set: Created 11 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
« chrome/browser/first_run_win.cc ('K') | « chrome/browser/first_run_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/importer/importer.cc
diff --git a/chrome/browser/importer/importer.cc b/chrome/browser/importer/importer.cc
index 7e3ad0f2d5ff2a15502ae07ce26914f3fef708f9..ab02a416b6a61fa58cbe9298e3cc1f8f37a59626 100644
--- a/chrome/browser/importer/importer.cc
+++ b/chrome/browser/importer/importer.cc
@@ -528,6 +528,12 @@ void ImporterHost::StartImportSettings(const ProfileInfo& profile_info,
// will be notified.
writer_ = writer;
importer_ = CreateImporterByType(profile_info.browser_type);
+ // If we fail to create Importer, exit as we can not do anything.
+ if (!importer_) {
+ ImportEnded();
+ return;
+ }
+
importer_->AddRef();
bool import_to_bookmark_bar = first_run;
« chrome/browser/first_run_win.cc ('K') | « chrome/browser/first_run_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698