fix: don't crash on tray.setContextMenu(null) (#14331)

This commit is contained in:
trop[bot] 2018-08-27 13:27:41 -07:00 committed by Shelley Vohr
parent 97058837e7
commit c8a21dbb92
4 changed files with 38 additions and 6 deletions

View file

@ -210,7 +210,7 @@ void Tray::PopUpContextMenu(mate::Arguments* args) {
void Tray::SetContextMenu(v8::Isolate* isolate, mate::Handle<Menu> menu) {
menu_.Reset(isolate, menu.ToV8());
tray_icon_->SetContextMenu(menu->model());
tray_icon_->SetContextMenu(menu.IsEmpty() ? nullptr : menu->model());
}
gfx::Rect Tray::GetBounds() {