summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-03-14 23:07:38 +0100
committerAndreas Kling <kling@serenityos.org>2022-03-15 19:48:19 +0100
commit8aa24c45dd3ebc7c53670268cfb27a0fdb949faf (patch)
tree5864fd5680284302d080586e88db559c5bb3dd86 /Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp
parent5b8290dfa3982e029c84b888a8ba493d7a718c3a (diff)
downloadserenity-8aa24c45dd3ebc7c53670268cfb27a0fdb949faf.zip
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.
Diffstat (limited to 'Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp')
-rw-r--r--Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp b/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp
index 66b18d9bc1..9291176ce9 100644
--- a/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp
+++ b/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp
@@ -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