diff --git a/modules/synacormediaBidAdapter.js b/modules/synacormediaBidAdapter.js index 3412d2fd417..3879d676d99 100644 --- a/modules/synacormediaBidAdapter.js +++ b/modules/synacormediaBidAdapter.js @@ -45,12 +45,9 @@ export const spec = { imp: [] }; - if (bidderRequest.bids != undefined && bidderRequest.bids[0] != undefined) { - const schain = bidderRequest.bids[0].schain; - if (schain) { - openRtbBidRequest.source = {}; - openRtbBidRequest.source.ext = { schain }; - } + const schain = validBidReqs[0].schain; + if (schain) { + openRtbBidRequest.source = { ext: { schain } }; } let seatId = null; @@ -67,7 +64,7 @@ export const spec = { if (isNaN(bidFloor)) { logWarn(`Synacormedia: there is an invalid bid floor: ${bid.params.bidfloor}`); } - let pos = parseInt(bid.params.pos); + let pos = parseInt(bid.params.pos, 10); if (isNaN(pos)) { logWarn(`Synacormedia: there is an invalid POS: ${bid.params.pos}`); pos = 0; diff --git a/test/spec/modules/synacormediaBidAdapter_spec.js b/test/spec/modules/synacormediaBidAdapter_spec.js index 41194cbdf51..4f59fdd19e0 100644 --- a/test/spec/modules/synacormediaBidAdapter_spec.js +++ b/test/spec/modules/synacormediaBidAdapter_spec.js @@ -562,7 +562,18 @@ describe('synacormediaBidAdapter ', function () { src: 'client', bidRequestsCount: 1, bidderRequestsCount: 1, - bidderWinsCount: 0 + bidderWinsCount: 0, + schain: { + ver: '1.0', + complete: 1, + nodes: [ + { + asi: 'indirectseller.com', + sid: '00001', + hp: 1 + } + ] + } }; let bidderRequest = { refererInfo: {