diff --git a/src/scripts/search-engines/google-desktop.ts b/src/scripts/search-engines/google-desktop.ts index 1c5b8653b..5bb6600c8 100644 --- a/src/scripts/search-engines/google-desktop.ts +++ b/src/scripts/search-engines/google-desktop.ts @@ -665,7 +665,9 @@ export function getDesktopSerpHandler( tbm: string, udm: string, ): SerpHandler | null { - const serpHandler = desktopSerpHandlers[udm ? `udm=${udm}` : tbm]; + const udmKey = `udm=${udm}`; + const serpHandler = + desktopSerpHandlers[udmKey in desktopSerpHandlers ? udmKey : tbm]; if (!serpHandler) { return null; }