mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 19:27:35 +00:00
WindowServer: Don't crash when pressing return after opening menu
There isn't always a hovered item, so let's not assume things.
This commit is contained in:
parent
358ec1f1eb
commit
17e25890be
1 changed files with 1 additions and 2 deletions
|
@ -181,8 +181,7 @@ void MenuManager::event(Core::Event& event)
|
||||||
|
|
||||||
if (key_event.key() == Key_Return) {
|
if (key_event.key() == Key_Return) {
|
||||||
auto hovered_item = m_current_menu->hovered_item();
|
auto hovered_item = m_current_menu->hovered_item();
|
||||||
|
if (!hovered_item || !hovered_item->is_enabled())
|
||||||
if (!hovered_item->is_enabled())
|
|
||||||
return;
|
return;
|
||||||
if (hovered_item->is_submenu())
|
if (hovered_item->is_submenu())
|
||||||
m_current_menu->descend_into_submenu_at_hovered_item();
|
m_current_menu->descend_into_submenu_at_hovered_item();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue