WindowServer: Menu::popup() should return when the menu is empty

Previously the WindowServer would assert `!is_empty()` and crash.

Fixes #1689
This commit is contained in:
Brendan Coles 2020-04-07 17:59:48 +00:00 committed by Andreas Kling
parent 3e677fd03d
commit 6476f690fe
Notes: sideshowbarker 2024-07-19 07:49:42 +09:00

View file

@ -519,7 +519,10 @@ void Menu::redraw_if_theme_changed()
void Menu::popup(const Gfx::Point& position, bool is_submenu)
{
ASSERT(!is_empty());
if (is_empty()) {
dbg() << "Menu: Empty menu popup";
return;
}
auto& window = ensure_menu_window();
redraw_if_theme_changed();