From b495eda18775709b5823c517df577cf4142e1760 Mon Sep 17 00:00:00 2001 From: ako-adot <90328748+ako-adot@users.noreply.github.com> Date: Thu, 7 Jul 2022 16:39:29 +0200 Subject: [PATCH] ADOT Bid Adapter: fix handle empty refererInfo (#8643) * [DSP-3707] fix: Handle empty refererInfo [DSP-3707] fix: Handle empty refererInfo * [DSP-3707] fix: handle empty referer info --- modules/adotBidAdapter.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/adotBidAdapter.js b/modules/adotBidAdapter.js index 75dcef02b59f..869cd69a8306 100644 --- a/modules/adotBidAdapter.js +++ b/modules/adotBidAdapter.js @@ -49,15 +49,15 @@ function tryParse(data) { * @returns {Site|null} Formatted Site OpenRtb object or null */ function getOpenRTBSiteObject(bidderRequest) { - if (!bidderRequest || !bidderRequest.refererInfo) return null; + const refererInfo = (bidderRequest && bidderRequest.refererInfo) || null; - const domain = bidderRequest.refererInfo.domain; + const domain = refererInfo ? refererInfo.domain : window.location.hostname; const publisherId = config.getConfig('adot.publisherId'); if (!domain) return null; return { - page: bidderRequest.refererInfo.page, + page: refererInfo ? refererInfo.page : window.location.href, domain: domain, name: domain, publisher: {