From fbc95440a4d60cc7331a7f32eab9476f038c9ba5 Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Fri, 1 Sep 2023 22:13:30 +0200 Subject: [PATCH] LibWeb: Only return initialized navigables from child_navigables() Fixes a crash in `get_session_history_entries()` that happens when it attempts to find entries for a navigable that hasn't been fully initialized and therefore doesn't have a nested history entry yet. --- Userland/Libraries/LibWeb/HTML/Navigable.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Userland/Libraries/LibWeb/HTML/Navigable.cpp b/Userland/Libraries/LibWeb/HTML/Navigable.cpp index b315eb4923..3da0ab7518 100644 --- a/Userland/Libraries/LibWeb/HTML/Navigable.cpp +++ b/Userland/Libraries/LibWeb/HTML/Navigable.cpp @@ -62,6 +62,8 @@ Vector> Navigable::child_navigables() const { Vector> results; for (auto& entry : all_navigables()) { + if (entry->current_session_history_entry()->step == SessionHistoryEntry::Pending::Tag) + continue; if (entry->parent() == this) results.append(entry); }