mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
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:
parent
fb722e69f3
commit
5bb6e2c80c
Notes:
sideshowbarker
2024-07-17 07:48:42 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/5bb6e2c80c Pull-request: https://github.com/SerenityOS/serenity/pull/18896 Reviewed-by: https://github.com/trflynn89 ✅
1 changed files with 2 additions and 1 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue