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); |