mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 12:35:14 +00:00
LibWeb: Check for active document in descendant_navigables()
This is not in the spec, but I did see a null pointer dereference here while browsing the web, and it seems completely harmless for this function to skip over navigables without an active document.
This commit is contained in:
parent
aa585c4182
commit
56e1c0e7ee
Notes:
github-actions[bot]
2024-11-01 11:28:08 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/56e1c0e7eec
1 changed files with 5 additions and 1 deletions
|
@ -3240,7 +3240,11 @@ Vector<JS::Handle<HTML::Navigable>> Document::descendant_navigables()
|
|||
return TraversalDecision::Continue;
|
||||
|
||||
// 2. Extend navigables with navigableContainer's content navigable's active document's inclusive descendant navigables.
|
||||
navigables.extend(navigable_container.content_navigable()->active_document()->inclusive_descendant_navigables());
|
||||
auto document = navigable_container.content_navigable()->active_document();
|
||||
// AD-HOC: If the descendant navigable doesn't have an active document, just skip over it.
|
||||
if (!document)
|
||||
return TraversalDecision::Continue;
|
||||
navigables.extend(document->inclusive_descendant_navigables());
|
||||
}
|
||||
return TraversalDecision::Continue;
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue