Skip to content

Commit

Permalink
ADOT Bid Adapter: fix handle empty refererInfo (#8643)
Browse files Browse the repository at this point in the history
* [DSP-3707] fix: Handle empty refererInfo

[DSP-3707] fix: Handle empty refererInfo

* [DSP-3707] fix: handle empty referer info
  • Loading branch information
ako-adot authored and ahmadlob committed Jul 27, 2022
1 parent 43bf9b7 commit 0f4de77
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/adotBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down

0 comments on commit 0f4de77

Please sign in to comment.