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

Unified Diff: chrome/browser/ui/webui/options/chromeos/core_chromeos_options_handler.cc

Issue 169993002: Add check for user in cros settings handler (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: revert to patchset 1 Created 6 years, 10 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 | chrome/browser/ui/webui/options/chromeos/cros_language_options_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/options/chromeos/core_chromeos_options_handler.cc
diff --git a/chrome/browser/ui/webui/options/chromeos/core_chromeos_options_handler.cc b/chrome/browser/ui/webui/options/chromeos/core_chromeos_options_handler.cc
index 73d9c77881ff62e49e9bc816e0e826fd43e71ef0..9d72071d14d37f4fe66d035a06011badba5db9d6 100644
--- a/chrome/browser/ui/webui/options/chromeos/core_chromeos_options_handler.cc
+++ b/chrome/browser/ui/webui/options/chromeos/core_chromeos_options_handler.cc
@@ -255,11 +255,13 @@ void CoreChromeOSOptionsHandler::GetLocalizedValues(
AddAccountUITweaksLocalizedValues(localized_strings, profile);
UserManager* user_manager = UserManager::Get();
- const std::string& primary_email = user_manager->GetPrimaryUser()->email();
// Check at load time whether this is a secondary user in a multi-profile
// session.
- if (user_manager->GetUserByProfile(profile)->email() != primary_email) {
+ User* user = user_manager->GetUserByProfile(profile);
+ if (user && user->email() != user_manager->GetPrimaryUser()->email()) {
+ const std::string& primary_email = user_manager->GetPrimaryUser()->email();
+
// Set secondaryUser to show the shared icon by the network section header.
localized_strings->SetBoolean("secondaryUser", true);
localized_strings->SetString("secondaryUserBannerText",
« no previous file with comments | « no previous file | chrome/browser/ui/webui/options/chromeos/cros_language_options_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698