Index: chrome/browser/chrome_browser_main.cc |
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc |
index 1d362a634301b4178ce2a3d3f6b57a56dcf1a639..fb5034032e2085bdb551bd929c5420f4eb78b692 100644 |
--- a/chrome/browser/chrome_browser_main.cc |
+++ b/chrome/browser/chrome_browser_main.cc |
@@ -374,9 +374,11 @@ Profile* CreatePrimaryProfile(const content::MainFunctionParams& parameters, |
g_browser_process->profile_manager()->GetProfileInfoCache(); |
size_t profile_index = cache.GetIndexOfProfileWithPath(profile_path); |
- if (cache.ProfileIsSigninRequiredAtIndex(profile_index)) |
+ if (profile_index != std::string::npos && |
+ cache.ProfileIsSigninRequiredAtIndex(profile_index)) { |
profile = g_browser_process->profile_manager()->GetProfile( |
ProfileManager::GetGuestProfilePath()); |
+ } |
} |
#endif // defined(OS_CHROMEOS) || defined(OS_ANDROID) |
if (profile) { |