mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-11 01:06:01 +03: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
Notes:
sideshowbarker
2024-07-19 01:00:36 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/17e25890be1
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user