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

Unified Diff: chrome/browser/ui/ash/multi_user/multi_user_context_menu_chromeos.cc

Issue 141133006: Move a null check before it's usage. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 11 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/multi_user/multi_user_context_menu_chromeos.cc
diff --git a/chrome/browser/ui/ash/multi_user/multi_user_context_menu_chromeos.cc b/chrome/browser/ui/ash/multi_user/multi_user_context_menu_chromeos.cc
index 595f02e2c43531a8470d00741ffdaaf33e0a635d..aae89a11a1f14a1e0dbda81ae9c903e964078e1e 100644
--- a/chrome/browser/ui/ash/multi_user/multi_user_context_menu_chromeos.cc
+++ b/chrome/browser/ui/ash/multi_user/multi_user_context_menu_chromeos.cc
@@ -78,8 +78,11 @@ scoped_ptr<ui::MenuModel> CreateMultiUserContextMenu(
scoped_ptr<ui::MenuModel> model;
ash::SessionStateDelegate* delegate =
ash::Shell::GetInstance()->session_state_delegate();
+ if (!delegate)
+ return model.Pass();
+
int logged_in_users = delegate->NumberOfLoggedInUsers();
- if (delegate && logged_in_users > 1) {
+ if (logged_in_users > 1) {
// If this window is not owned, we don't show the menu addition.
chrome::MultiUserWindowManager* manager =
chrome::MultiUserWindowManager::GetInstance();
« 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