LibWeb: Make BrowsingContext::reset_cursor_blink_cycle() more robust

If the browsing context text cursor has become invalid for whatever
reason, don't try to repaint its associated node.
This commit is contained in:
Andreas Kling 2022-03-14 23:07:38 +01:00
parent 5b8290dfa3
commit 8aa24c45dd

View file

@ -54,7 +54,8 @@ void BrowsingContext::reset_cursor_blink_cycle()
{
m_cursor_blink_state = true;
m_cursor_blink_timer->restart();
m_cursor_position.node()->layout_node()->set_needs_display();
if (m_cursor_position.is_valid() && m_cursor_position.node()->layout_node())
m_cursor_position.node()->layout_node()->set_needs_display();
}
// https://html.spec.whatwg.org/multipage/browsers.html#top-level-browsing-context