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

Unified Diff: ash/root_window_controller.cc

Issue 13434005: Prevent crash when desktop controller is NULL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: simplify if Created 7 years, 9 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: ash/root_window_controller.cc
diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc
index 3af8f489002c05f1b530354e6ab9b435037b7505..7a6271a1c8dc98f1e6184a47dd2aa231cf339859 100644
--- a/ash/root_window_controller.cc
+++ b/ash/root_window_controller.cc
@@ -464,10 +464,16 @@ void RootWindowController::ShowContextMenu(
if (!menu_model.get())
return;
- views::MenuRunner menu_runner(menu_model.get());
- views::Widget* widget =
- root_window_->GetProperty(kDesktopController)->widget();
+ internal::DesktopBackgroundWidgetController* background =
+ root_window_->GetProperty(kDesktopController);
+ if (!background)
oshima 2013/04/04 13:44:51 can you explain when this happens in the comment w
Dmitry Polukhin 2013/04/04 14:42:45 Done.
+ return;
+ views::Widget* widget = background->widget();
+ if (!widget)
+ return;
oshima 2013/04/04 13:44:51 can this happen?
Dmitry Polukhin 2013/04/04 14:42:45 I haven't seen this - removed.
+
+ views::MenuRunner menu_runner(menu_model.get());
if (menu_runner.RunMenuAt(
widget, NULL, gfx::Rect(location_in_screen, gfx::Size()),
views::MenuItemView::TOPLEFT, views::MenuRunner::CONTEXT_MENU) ==
« 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