diff options
author | Andreas Kling <kling@serenityos.org> | 2021-09-11 02:13:06 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-09-11 02:13:06 +0200 |
commit | 5514f41f25de617ed70e75e15e04b03e37a2f1f1 (patch) | |
tree | 075456f63ac08d1b49d47449ff94f7bb8703fa8b /Userland/Libraries/LibWeb | |
parent | d69133e4acecae9faef1b803685f19a6ec4cb29f (diff) | |
download | serenity-5514f41f25de617ed70e75e15e04b03e37a2f1f1.zip |
LibWeb: Ignore keydown events when there is no layout tree
Diffstat (limited to 'Userland/Libraries/LibWeb')
-rw-r--r-- | Userland/Libraries/LibWeb/Page/EventHandler.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/Page/EventHandler.cpp b/Userland/Libraries/LibWeb/Page/EventHandler.cpp index 43322fff05..3fdcf84a90 100644 --- a/Userland/Libraries/LibWeb/Page/EventHandler.cpp +++ b/Userland/Libraries/LibWeb/Page/EventHandler.cpp @@ -395,6 +395,9 @@ bool EventHandler::handle_keydown(KeyCode key, unsigned modifiers, u32 code_poin return focus_next_element(); } + if (!layout_root()) + return false; + if (layout_root()->selection().is_valid()) { auto range = layout_root()->selection().to_dom_range()->normalized(); if (range->start_container()->is_editable()) { |