mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:07:44 +00:00
WindowServer: Don't crash when trying to close an empty menu
It's not normal to add empty menus to an app's menubar, but just in case someone does it anyway, let's not crash trying to close it.
This commit is contained in:
parent
6bb6176762
commit
353bf57378
1 changed files with 1 additions and 1 deletions
|
@ -402,7 +402,7 @@ void WSWindowManager::close_current_menu()
|
|||
m_current_menu->menu_window()->set_visible(false);
|
||||
m_current_menu = nullptr;
|
||||
for (auto& menu : m_menu_manager.open_menu_stack()) {
|
||||
if (menu)
|
||||
if (menu && menu->menu_window())
|
||||
menu->menu_window()->set_visible(false);
|
||||
}
|
||||
m_menu_manager.open_menu_stack().clear();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue