Skip to content

Commit

Permalink
Fix conflict and nobid condition
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewlane committed Oct 26, 2017
1 parent 5ed48ac commit 9e6d46f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions modules/dfpAdServerVideo.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ export default function buildDfpVideoUrl(options) {

if (!config.getConfig('usePrebidCache')) {
if (!deepAccess(options, 'params.description_url')) {
queryParams.description_url = encodeURIComponent(bid.vastUrl);
const vastUrl = bid && bid.vastUrl;
queryParams.description_url = encodeURIComponent(vastUrl);
} else {
logError(`input object cannot contain description_url`);
}
Expand All @@ -123,14 +124,16 @@ export default function buildDfpVideoUrl(options) {
function buildUrlFromAdserverUrlComponents(components, bid) {
if (!config.getConfig('usePrebidCache')) {
if (!deepAccess(components, 'search.description_url')) {
components.search.description_url = encodeURIComponent(bid.vastUrl);
const vastUrl = bid && bid.vastUrl;
components.search.description_url = encodeURIComponent(vastUrl);
} else {
logError(`input url cannnot contain description_url`);
}
}

const adserverTargeting = (bid && bid.adserverTargeting) || {};
const customParams = Object.assign({},
bid.adserverTargeting,
adserverTargeting,
);
components.search.cust_params = encodeURIComponent(formatQS(customParams));

Expand Down

0 comments on commit 9e6d46f

Please sign in to comment.