From 8b7d49efa4e08f6c9b1179bf9064290c00588ba2 Mon Sep 17 00:00:00 2001 From: Rich Audience Date: Mon, 24 Jan 2022 16:25:36 +0100 Subject: [PATCH] Richaudience Bid Adapter: uncaught error on non-gdpr locations #7955 (#7962) Co-authored-by: sgimenez --- modules/richaudienceBidAdapter.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/richaudienceBidAdapter.js b/modules/richaudienceBidAdapter.js index 0f62e988249..f90bfd117ac 100755 --- a/modules/richaudienceBidAdapter.js +++ b/modules/richaudienceBidAdapter.js @@ -59,10 +59,15 @@ export const spec = { REFERER = (typeof bidderRequest.refererInfo.referer != 'undefined' ? encodeURIComponent(bidderRequest.refererInfo.referer) : null) payload.gdpr_consent = ''; - payload.gdpr = bidderRequest.gdprConsent.gdprApplies; + payload.gdpr = false; if (bidderRequest && bidderRequest.gdprConsent) { - payload.gdpr_consent = bidderRequest.gdprConsent.consentString; + if (typeof bidderRequest.gdprConsent.gdprApplies != 'undefined') { + payload.gdpr = bidderRequest.gdprConsent.gdprApplies; + } + if (typeof bidderRequest.gdprConsent.consentString != 'undefined') { + payload.gdpr_consent = bidderRequest.gdprConsent.consentString; + } } var payloadString = JSON.stringify(payload);