fix: Menu.setApplicationMenu(null) crash on Linux (#12983)

This commit is contained in:
Jeremy Apthorp 2018-05-18 10:29:28 -07:00 committed by GitHub
parent 91173320e6
commit 156a97b80d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -209,7 +209,9 @@ void GlobalMenuBarX11::SetMenu(AtomMenuModel* menu_model) {
DbusmenuMenuitem* root_item = menuitem_new();
menuitem_property_set(root_item, kPropertyLabel, "Root");
menuitem_property_set_bool(root_item, kPropertyVisible, true);
BuildMenuFromModel(menu_model, root_item);
if (menu_model != nullptr) {
BuildMenuFromModel(menu_model, root_item);
}
server_set_root(server_, root_item);
g_object_unref(root_item);