diff --git a/apps/browser/src/autofill/services/collect-autofill-content.service.ts b/apps/browser/src/autofill/services/collect-autofill-content.service.ts index f623e0f6c9..1de801a2c2 100644 --- a/apps/browser/src/autofill/services/collect-autofill-content.service.ts +++ b/apps/browser/src/autofill/services/collect-autofill-content.service.ts @@ -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