[PM-6575] Collection of page details might error when getting text content from field sibilings (#8169)

This commit is contained in:
Cesar Gonzalez 2024-03-14 15:29:37 -05:00 committed by GitHub
parent 34fbfaf2ee
commit 16bbddf0e7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 0 deletions

View File

@ -755,6 +755,9 @@ class CollectAutofillContentService implements CollectAutofillContentServiceInte
// Prioritize capturing text content from elements rather than nodes.
currentElement = currentElement.parentElement || currentElement.parentNode;
if (!currentElement) {
return textContentItems;
}
let siblingElement = nodeIsElement(currentElement)
? currentElement.previousElementSibling