From 5bb6e2c80cc9ba69269be4d9edefcdaa09be3296 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 17 May 2023 20:54:11 +0200 Subject: [PATCH] LibWeb: Null-check layout node before dereferencing in HTMLVideoElement DOM elements don't always have a corresponding layout node. This fixes a crash soon after loading the Steam store. --- Userland/Libraries/LibWeb/HTML/HTMLVideoElement.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLVideoElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLVideoElement.cpp index 8324aa5ef26..4cee08b6b4c 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLVideoElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLVideoElement.cpp @@ -109,7 +109,8 @@ void HTMLVideoElement::set_video_track(JS::GCPtr video_track) void HTMLVideoElement::set_current_frame(Badge, RefPtr frame, double position) { m_current_frame = { move(frame), position }; - layout_node()->set_needs_display(); + if (layout_node()) + layout_node()->set_needs_display(); } void HTMLVideoElement::on_playing()