Skip to content

Commit

Permalink
Merge pull request #423 from PubMatic-OpenWrap/UOE-5788
Browse files Browse the repository at this point in the history
Uoe 5788
  • Loading branch information
pm-manasi-moghe committed Nov 24, 2020
2 parents bb00c5c + 0cd334a commit 073f2a7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions modules/id5IdSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,11 @@ export const id5IdSubmodule = {
if (!hasRequiredParams(configParams)) {
return undefined;
}
if (!configParams || typeof parseInt(configParams.partner) !== 'number') {
//This check is redundant. moving it to the 'hasRequiredParams function instead' - UOE-5788
/*if (!configParams || typeof parseInt(configParams.partner) !== 'number') {
utils.logError(`User ID - ID5 submodule requires partner to be defined as a number`);
}
return undefined;
}*/
configParams.partner = parseInt(configParams.partner)
const hasGdpr = (consentData && typeof consentData.gdprApplies === 'boolean' && consentData.gdprApplies) ? 1 : 0;
const gdprConsentString = hasGdpr ? consentData.consentString : '';
Expand Down Expand Up @@ -125,8 +127,8 @@ export const id5IdSubmodule = {
};

function hasRequiredParams(configParams) {
if (!configParams || typeof configParams.partner !== 'number') {
utils.logError(`User ID - ID5 submodule requires partner to be defined as a number`);
if (!configParams || typeof parseInt(configParams.partner) !== 'number' || isNaN(parseInt(configParams.partner))) {
utils.logError(`User ID - ID5 submodule requires partner to be defined as a number - Current value received: ` + configParams.partner);
return false;
}
return true;
Expand Down

0 comments on commit 073f2a7

Please sign in to comment.