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.
This commit is contained in:
Aliaksandr Kalenik 2023-09-01 22:13:30 +02:00 committed by Andreas Kling
parent 15d265da65
commit fbc95440a4
Notes: sideshowbarker 2024-07-17 07:14:09 +09:00

View file

@ -62,6 +62,8 @@ Vector<JS::Handle<Navigable>> Navigable::child_navigables() const
{
Vector<JS::Handle<Navigable>> results;
for (auto& entry : all_navigables()) {
if (entry->current_session_history_entry()->step == SessionHistoryEntry::Pending::Tag)
continue;
if (entry->parent() == this)
results.append(entry);
}