1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-25 21:35:07 +00:00

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

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();