diff --git a/backend/src/data/Phisherman.ts b/backend/src/data/Phisherman.ts index c50f67b1..5f95f347 100644 --- a/backend/src/data/Phisherman.ts +++ b/backend/src/data/Phisherman.ts @@ -129,10 +129,11 @@ async function fetchDomainInfo(domain: string): Promise>("GET", `/v2/domains/info/${domain}`); - const domainInfo = result[domain]; + const firstKey = Object.keys(result)[0]; + const domainInfo = firstKey ? result[firstKey] : null; if (!domainInfo) { // tslint:disable-next-line:no-console - console.warn("Unexpected Phisherman API response:", result); + console.warn(`Unexpected Phisherman API response for ${domain}:`, result); return null; } if (domainInfo.classification === "unknown") {