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

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

Issue 2047483003: Add fallback behavior if the last used profile cannot initialize (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bug-614753-fix
Patch Set: Handle the case where the selected profile is not in ProfileAttributesStorage Created 4 years, 6 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 e3acad3245bcec2402530d7f62da5aba6b7dbbf0..1353c66bf917b4899e6dea3f27e81acdea7e039b 100644
--- a/chrome/browser/profiles/profiles_state.cc
+++ b/chrome/browser/profiles/profiles_state.cc
@@ -215,9 +215,10 @@ bool SetActiveProfileToGuestIfLocked() {
bool has_entry =
g_browser_process->profile_manager()->GetProfileAttributesStorage().
GetProfileAttributesWithPath(active_profile_path, &entry);
- DCHECK(has_entry);
- if (!entry->IsSigninRequired())
+ // |has_entry| is possible to be false if a profile is specified in the
+ // --profile-directory switch.
Peter Kasting 2016/07/01 00:53:23 Nit: "|has_entry| may be false when the user speci
WC Leung 2016/07/07 17:01:53 Done.
+ if (has_entry && !entry->IsSigninRequired())
return false;
SetLastUsedProfile(guest_path.BaseName().MaybeAsASCII());

Powered by Google App Engine
This is Rietveld 408576698