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

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: fix indent 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/profiles/profiles_state.cc
diff --git a/chrome/browser/profiles/profiles_state.cc b/chrome/browser/profiles/profiles_state.cc
index dd532c29ca79870b9dabf2034715279e6a402f1f..9465e8b22df7d9161a747fb689b26c8a69b10fd8 100644
--- a/chrome/browser/profiles/profiles_state.cc
+++ b/chrome/browser/profiles/profiles_state.cc
@@ -193,7 +193,8 @@ 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))
Mike Lerman 2015/03/31 20:48:30 nit: 2 line condition means the if needs braces, p
noms (inactive) 2015/03/31 21:01:33 Done.
return false;
PrefService* local_state = g_browser_process->local_state();
« chrome/browser/chrome_browser_main.cc ('K') | « chrome/browser/chrome_browser_main.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698