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

Unified Diff: chrome/browser/ui/ash/chrome_shell_delegate.cc

Issue 2864453003: The user's profile might not be ready even if we have an active user (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/ash/chrome_shell_delegate.cc
diff --git a/chrome/browser/ui/ash/chrome_shell_delegate.cc b/chrome/browser/ui/ash/chrome_shell_delegate.cc
index ca5956b76987ffe576cd62a964fe60de90743c75..b550ad2e967d17fd79e488c9f81b614caf89f402 100644
--- a/chrome/browser/ui/ash/chrome_shell_delegate.cc
+++ b/chrome/browser/ui/ash/chrome_shell_delegate.cc
@@ -561,10 +561,12 @@ gfx::Image ChromeShellDelegate::GetDeprecatedAcceleratorImage() const {
PrefService* ChromeShellDelegate::GetActiveUserPrefService() const {
const user_manager::User* const user =
user_manager::UserManager::Get()->GetActiveUser();
- return user ? chromeos::ProfileHelper::Get()
- ->GetProfileByUser(user)
- ->GetPrefs()
- : nullptr;
+ if (!user)
+ return nullptr;
+
+ // The user's profile might not be ready yet, so we must check for that too.
+ Profile* profile = chromeos::ProfileHelper::Get()->GetProfileByUser(user);
+ return profile ? profile->GetPrefs() : nullptr;
}
bool ChromeShellDelegate::IsTouchscreenEnabledInPrefs(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698