mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 15:45:25 +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:
@@ -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();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user