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( |