mirror of
https://github.com/RGBCube/serenity
synced 2025-05-25 15:55: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:
parent
3e677fd03d
commit
6476f690fe
1 changed files with 4 additions and 1 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue