mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +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:
@@ -181,8 +181,7 @@ void MenuManager::event(Core::Event& event)
|
||||
|
||||
if (key_event.key() == Key_Return) {
|
||||
auto hovered_item = m_current_menu->hovered_item();
|
||||
|
||||
if (!hovered_item->is_enabled())
|
||||
if (!hovered_item || !hovered_item->is_enabled())
|
||||
return;
|
||||
if (hovered_item->is_submenu())
|
||||
m_current_menu->descend_into_submenu_at_hovered_item();
|
||||
|
||||
Reference in New Issue
Block a user