소스 검색

LibWeb: Ignore keydown events when there is no layout tree

Andreas Kling 3 년 전
부모
커밋
5514f41f25
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      Userland/Libraries/LibWeb/Page/EventHandler.cpp

+ 3 - 0
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()) {