From b5895920bf84b4e9ec733bdf7722d4f402c16997 Mon Sep 17 00:00:00 2001 From: Jimmy Vo Date: Wed, 19 Mar 2025 13:29:37 -0400 Subject: [PATCH] Account for no responses. --- .../trigger-phishing-detection-script-injection.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/browser/src/phishing-detection/trigger-phishing-detection-script-injection.ts b/apps/browser/src/phishing-detection/trigger-phishing-detection-script-injection.ts index 167d76da7cc..90251eb13cd 100644 --- a/apps/browser/src/phishing-detection/trigger-phishing-detection-script-injection.ts +++ b/apps/browser/src/phishing-detection/trigger-phishing-detection-script-injection.ts @@ -15,11 +15,17 @@ if (document.readyState === "loading") { async function loadPhishingDetectionContent() { const activeUrl = PhishingDetectionBrowserService.getActiveUrl(); - const { isPhishingDomain } = await chrome.runtime.sendMessage({ + const response = await chrome.runtime.sendMessage({ command: PhishingDetectionCommands.CheckUrl, activeUrl, }); + if (!response) { + return; + } + + const { isPhishingDomain } = response; + if (isPhishingDomain) { const url = new URL(activeUrl);