From f1642f182cfbd69b5f5daee0eabb1e917aa1c972 Mon Sep 17 00:00:00 2001 From: Pierre-Antoine Durgeat Date: Fri, 20 Sep 2019 06:13:38 +0200 Subject: [PATCH] [UserId] - ID5 - Fixed case when consentData is undefined (No CMP) (#4215) --- modules/id5IdSystem.js | 2 +- modules/userId/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/id5IdSystem.js b/modules/id5IdSystem.js index 85619ba51ba..6fb5014c962 100644 --- a/modules/id5IdSystem.js +++ b/modules/id5IdSystem.js @@ -38,7 +38,7 @@ export const id5IdSubmodule = { utils.logError(`User ID - ID5 submodule requires partner to be defined as a number`); return undefined; } - const hasGdpr = (typeof consentData.gdprApplies === 'boolean' && consentData.gdprApplies) ? 1 : 0; + const hasGdpr = (consentData && typeof consentData.gdprApplies === 'boolean' && consentData.gdprApplies) ? 1 : 0; const gdprConsentString = hasGdpr ? consentData.consentString : ''; const storedUserId = this.decode(cacheIdObj); const url = `https://id5-sync.com/g/v1/${configParams.partner}.json?1puid=${storedUserId ? storedUserId.id5id : ''}&gdpr=${hasGdpr}&gdpr_consent=${gdprConsentString}`; diff --git a/modules/userId/index.js b/modules/userId/index.js index 8a70a4bbf3c..fb7a748b7ec 100644 --- a/modules/userId/index.js +++ b/modules/userId/index.js @@ -12,7 +12,7 @@ * @summary performs action to obtain id and return a value in the callback's response argument * @name Submodule#getId * @param {SubmoduleParams} configParams - * @param {ConsentData} consentData + * @param {ConsentData|undefined} consentData * @param {(Object|undefined)} cacheIdObj * @return {(Object|function)} id data or a callback, the callback is called on the auction end event */