diff options
author | Andreas Kling <kling@serenityos.org> | 2023-05-17 20:54:11 +0200 |
---|---|---|
committer | Tim Flynn <trflynn89@pm.me> | 2023-05-17 13:09:02 -0700 |
commit | 5bb6e2c80cc9ba69269be4d9edefcdaa09be3296 (patch) | |
tree | f940b7522dcf6a471b6383eedccab7ebfd254898 /Userland | |
parent | fb722e69f35cfa7639b971677d4031ae320959d5 (diff) | |
download | serenity-5bb6e2c80cc9ba69269be4d9edefcdaa09be3296.zip |
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.
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibWeb/HTML/HTMLVideoElement.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLVideoElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLVideoElement.cpp index 8324aa5ef2..4cee08b6b4 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<HTML::VideoTrack> video_track) void HTMLVideoElement::set_current_frame(Badge<VideoTrack>, RefPtr<Gfx::Bitmap> 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() |