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

Unified Diff: chrome/browser/profiles/profiles_state.cc

Issue 1042923003: Fail gracefully when starting Chrome with an invalid kProfileDirectory. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 8 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/chrome_browser_main.cc ('k') | chrome/browser/ui/browser_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profiles_state.cc
diff --git a/chrome/browser/profiles/profiles_state.cc b/chrome/browser/profiles/profiles_state.cc
index dd532c29ca79870b9dabf2034715279e6a402f1f..85a465fa4e06f1f017be921bd010a1d504534904 100644
--- a/chrome/browser/profiles/profiles_state.cc
+++ b/chrome/browser/profiles/profiles_state.cc
@@ -193,8 +193,10 @@ bool SetActiveProfileToGuestIfLocked() {
const ProfileInfoCache& cache = profile_manager->GetProfileInfoCache();
size_t index = cache.GetIndexOfProfileWithPath(active_profile_path);
- if (!cache.ProfileIsSigninRequiredAtIndex(index))
+ if (index == std::string::npos ||
+ !cache.ProfileIsSigninRequiredAtIndex(index)) {
return false;
+ }
PrefService* local_state = g_browser_process->local_state();
DCHECK(local_state);
« no previous file with comments | « chrome/browser/chrome_browser_main.cc ('k') | chrome/browser/ui/browser_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698