diff --git a/Userland/Libraries/LibWeb/DOM/Document.cpp b/Userland/Libraries/LibWeb/DOM/Document.cpp index da2c43b674..c140a423af 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.cpp +++ b/Userland/Libraries/LibWeb/DOM/Document.cpp @@ -4051,8 +4051,11 @@ void Document::shared_declarative_refresh_steps(StringView input, JS::GCPtrnavigate({ .url = url_record, .source_document = *this })); + auto navigable = this->navigable(); + if (!navigable || navigable->has_been_destroyed()) + return; + + MUST(navigable->navigate({ .url = url_record, .source_document = *this, .history_handling = Bindings::NavigationHistoryBehavior::Replace })); }); // For the purposes of the previous paragraph, a refresh is said to have come due as soon as the later of the