Bläddra i källkod

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.
Aliaksandr Kalenik 1 år sedan
förälder
incheckning
fbc95440a4
1 ändrade filer med 2 tillägg och 0 borttagningar
  1. 2 0
      Userland/Libraries/LibWeb/HTML/Navigable.cpp

+ 2 - 0
Userland/Libraries/LibWeb/HTML/Navigable.cpp

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