Commit 3c62345e authored by noms's avatar noms Committed by Commit bot

Fail gracefully if the active profile can't be found in the ProfileInfoCache

The underlying reason for not finding the profile is probably crbug.com/464616,
but this should still not crash.

BUG=421215

Review URL: https://codereview.chromium.org/1021613002

Cr-Commit-Position: refs/heads/master@{#321353}
parent eeca96c0
......@@ -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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment