]> khamidou — GitHub mirrors - electron.git/commitdiff
Check context menu when calling popContextMenu API.
authorHaojian Wu <hokein.wu@gmail.com>
Tue, 4 Aug 2015 11:45:44 +0000 (19:45 +0800)
committerHaojian Wu <hokein.wu@gmail.com>
Tue, 4 Aug 2015 11:45:44 +0000 (19:45 +0800)
atom/browser/ui/win/notify_icon.cc

index fd9a90ae1d5d8b5f9afb67e49b02c764e6ff8069..962dc871b5b67a4e60e2528f859b4594e8e48202 100644 (file)
@@ -162,6 +162,9 @@ void NotifyIcon::DisplayBalloon(const gfx::Image& icon,
 }
 
 void NotifyIcon::PopContextMenu(const gfx::Point& pos) {
+  // Returns if context menu isn't set.
+  if (!menu_model_)
+    return;
   // Set our window as the foreground window, so the context menu closes when
   // we click away from it.
   if (!SetForegroundWindow(window_))