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.
This commit is contained in:
Andreas Kling 2023-05-17 20:54:11 +02:00 committed by Tim Flynn
parent fb722e69f3
commit 5bb6e2c80c
Notes: sideshowbarker 2024-07-17 07:48:42 +09:00

View file

@ -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()