Index: chrome/browser/ui/startup/startup_browser_creator_impl.cc |
diff --git a/chrome/browser/ui/startup/startup_browser_creator_impl.cc b/chrome/browser/ui/startup/startup_browser_creator_impl.cc |
index 9e7aace570ea6f16b5ef738c7a542261564ec857..7434d9c7fff09403842d49496424ac332178f970 100644 |
--- a/chrome/browser/ui/startup/startup_browser_creator_impl.cc |
+++ b/chrome/browser/ui/startup/startup_browser_creator_impl.cc |
@@ -643,9 +643,13 @@ bool StartupBrowserCreatorImpl::ProcessStartupURLs( |
VLOG(1) << "Pref: default"; |
// The only time apps get restored is when the browser process is restarted. |
- if (StartupBrowserCreator::WasRestarted()) |
- extensions::AppRestoreServiceFactory::GetForProfile(profile_)-> |
- RestoreApps(); |
+ if (StartupBrowserCreator::WasRestarted()) { |
+ extensions::AppRestoreService* service = |
+ extensions::AppRestoreServiceFactory::GetForProfile(profile_); |
+ // NULL in incognito mode. |
+ if (service) |
+ service->RestoreApps(); |
+ } |
if (pref.type == SessionStartupPref::LAST) { |
if (profile_->GetLastSessionExitType() == Profile::EXIT_CRASHED && |