WindowServer: MenuManager::handle_mouse_event() return if window is null
Previously the WindowServer would assert `topmost_menu->menu_window()` and crash. Fixes #1716
This commit is contained in:
parent
fec8763c21
commit
64536f19f0
Notes:
sideshowbarker
2024-07-19 07:46:17 +09:00
Author: https://github.com/bcoles Commit: https://github.com/SerenityOS/serenity/commit/64536f19f04 Pull-request: https://github.com/SerenityOS/serenity/pull/1717 Issue: https://github.com/SerenityOS/serenity/issues/1716
1 changed files with 4 additions and 1 deletions
|
@ -172,7 +172,10 @@ void MenuManager::handle_mouse_event(MouseEvent& mouse_event)
|
|||
auto* topmost_menu = m_open_menu_stack.last().ptr();
|
||||
ASSERT(topmost_menu);
|
||||
auto* window = topmost_menu->menu_window();
|
||||
ASSERT(window);
|
||||
if (!window) {
|
||||
dbg() << "MenuManager::handle_mouse_event: No menu window";
|
||||
return;
|
||||
}
|
||||
ASSERT(window->is_visible());
|
||||
|
||||
bool event_is_inside_current_menu = window->rect().contains(mouse_event.position());
|
||||
|
|
Loading…
Add table
Reference in a new issue