From 16bbddf0e7f5923bd657447de15cfc8238fb867f Mon Sep 17 00:00:00 2001 From: Cesar Gonzalez Date: Thu, 14 Mar 2024 15:29:37 -0500 Subject: [PATCH] [PM-6575] Collection of page details might error when getting text content from field sibilings (#8169) --- .../src/autofill/services/collect-autofill-content.service.ts | 3 +++ 1 file changed, 3 insertions(+) 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