diff --git a/modules/rubiconBidAdapter.js b/modules/rubiconBidAdapter.js index a8842facb6a..caeb6b3ced2 100644 --- a/modules/rubiconBidAdapter.js +++ b/modules/rubiconBidAdapter.js @@ -196,8 +196,8 @@ export const converter = ortbConverter({ if (config.getConfig('s2sConfig.defaultTtl')) { imp.exp = config.getConfig('s2sConfig.defaultTtl'); }; - bidRequest.params.position === 'atf' && (imp.video.pos = 1); - bidRequest.params.position === 'btf' && (imp.video.pos = 3); + bidRequest.params.position === 'atf' && imp.video && (imp.video.pos = 1); + bidRequest.params.position === 'btf' && imp.video && (imp.video.pos = 3); delete imp.ext?.prebid?.storedrequest; if (bidRequest.params.bidonmultiformat === true && bidRequestType.length > 1) { diff --git a/test/spec/modules/rubiconBidAdapter_spec.js b/test/spec/modules/rubiconBidAdapter_spec.js index d04b8075134..dc3ff1cb871 100644 --- a/test/spec/modules/rubiconBidAdapter_spec.js +++ b/test/spec/modules/rubiconBidAdapter_spec.js @@ -2636,6 +2636,18 @@ describe('the rubicon adapter', function () { expect(request.data.imp).to.have.nested.property('[0].native'); }); + it('should not break if position is set and no video MT', function () { + const bidReq = addNativeToBidRequest(bidderRequest); + delete bidReq.bids[0].mediaTypes.banner; + bidReq.bids[0].params = { + position: 'atf' + } + let [request] = spec.buildRequests(bidReq.bids, bidReq); + expect(request.method).to.equal('POST'); + expect(request.url).to.equal('https://prebid-server.rubiconproject.com/openrtb2/auction'); + expect(request.data.imp).to.have.nested.property('[0].native'); + }); + describe('that contains also a banner mediaType', function () { it('should send the banner to fastlane BUT NOT the native bid because missing params.video', function() { const bidReq = addNativeToBidRequest(bidderRequest);