mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-15 04:13:11 +00:00
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
|
@ -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…
Reference in a new issue