mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-24 13:35:12 +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
Notes:
sideshowbarker
2024-07-19 07:49:42 +09:00
Author: https://github.com/bcoles Commit: https://github.com/SerenityOS/serenity/commit/6476f690feb Pull-request: https://github.com/SerenityOS/serenity/pull/1690 Issue: https://github.com/SerenityOS/serenity/issues/1689
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
Reference in a new issue