mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
LibWeb: Add missing navigable null check in Document::open()
I saw a null pointer dereference here on GitHub once, but don't know how to reproduce, or how we'd get here. Nevertheless, null-checking the navigable is reasonable so let's do it.
This commit is contained in:
parent
63a56a77a2
commit
9c205537e1
Notes:
sideshowbarker
2024-07-16 20:12:13 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/9c205537e1
1 changed files with 1 additions and 1 deletions
|
@ -556,7 +556,7 @@ WebIDL::ExceptionOr<Document*> Document::open(Optional<String> const&, Optional<
|
|||
// If document belongs to a child navigable, we need to make sure its initial navigation is done,
|
||||
// because subsequent steps will modify "initial about:blank" to false, which would cause
|
||||
// initial navigation to fail in case it was "about:blank".
|
||||
if (auto navigable = this->navigable(); navigable->container() && !navigable->container()->content_navigable_initialized()) {
|
||||
if (auto navigable = this->navigable(); navigable && navigable->container() && !navigable->container()->content_navigable_initialized()) {
|
||||
HTML::main_thread_event_loop().spin_processing_tasks_with_source_until(HTML::Task::Source::NavigationAndTraversal, [navigable_container = navigable->container()] {
|
||||
return navigable_container->content_navigable_initialized();
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue