mirror of
https://github.com/RGBCube/serenity
synced 2025-05-23 18:25:08 +00:00
LibWeb: Fix null dereference in HtmlView::mousedown_event
Running event handlers in response to a mouse event may cause full layout invalidation, so we can't expect the layout root to be present right after returning from JS. Fixes #1629.
This commit is contained in:
parent
e586dc285a
commit
f8d6d61da5
1 changed files with 2 additions and 1 deletions
|
@ -242,7 +242,8 @@ void HtmlView::mousedown_event(GUI::MouseEvent& event)
|
|||
}
|
||||
} else {
|
||||
if (event.button() == GUI::MouseButton::Left) {
|
||||
layout_root()->selection().set({ result.layout_node, result.index_in_node }, {});
|
||||
if (layout_root())
|
||||
layout_root()->selection().set({ result.layout_node, result.index_in_node }, {});
|
||||
dump_selection("MouseDown");
|
||||
m_in_mouse_selection = true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue