From b47c478c5c5fa5908fe96ee9956e8cfbdebe3bb7 Mon Sep 17 00:00:00 2001 From: Cesar Gonzalez Date: Tue, 19 Mar 2024 09:51:48 -0500 Subject: [PATCH] [PM-6921] Incorporating method for ensuring that we clear the Map datastructure when the page details are being removed --- apps/browser/src/autofill/background/overlay.background.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/browser/src/autofill/background/overlay.background.ts b/apps/browser/src/autofill/background/overlay.background.ts index 580194922a3..52dd97a6865 100644 --- a/apps/browser/src/autofill/background/overlay.background.ts +++ b/apps/browser/src/autofill/background/overlay.background.ts @@ -112,6 +112,11 @@ class OverlayBackground implements OverlayBackgroundInterface { * @param tabId - Used to reference the page details of a specific tab */ removePageDetails(tabId: number) { + if (!this.pageDetailsForTab[tabId]) { + return; + } + + this.pageDetailsForTab[tabId].clear(); delete this.pageDetailsForTab[tabId]; }