1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:08:12 +00:00

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

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);
}