mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:57:45 +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
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();
|
auto* topmost_menu = m_open_menu_stack.last().ptr();
|
||||||
ASSERT(topmost_menu);
|
ASSERT(topmost_menu);
|
||||||
auto* window = topmost_menu->menu_window();
|
auto* window = topmost_menu->menu_window();
|
||||||
ASSERT(window);
|
if (!window) {
|
||||||
|
dbg() << "MenuManager::handle_mouse_event: No menu window";
|
||||||
|
return;
|
||||||
|
}
|
||||||
ASSERT(window->is_visible());
|
ASSERT(window->is_visible());
|
||||||
|
|
||||||
bool event_is_inside_current_menu = window->rect().contains(mouse_event.position());
|
bool event_is_inside_current_menu = window->rect().contains(mouse_event.position());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue