Skip to content

Commit

Permalink
add null checks (prebid#2814)
Browse files Browse the repository at this point in the history
  • Loading branch information
ankur-modi authored and AdSpacesDevelopers committed Jan 30, 2019
1 parent 9dece95 commit d1afcd9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/oneVideoBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ function getSize(sizes) {
function getRequestData(bid) {
let loc = utils.getTopWindowLocation();
let global = (window.top) ? window.top : window;
let page = (bid.params.site.page) ? (bid.params.site.page) : (loc.href);
let ref = (bid.params.site.referrer) ? bid.params.site.referrer : utils.getTopWindowReferrer();
let page = (bid.params.site && bid.params.site.page) ? (bid.params.site.page) : (loc.href);
let ref = (bid.params.site && bid.params.site.referrer) ? bid.params.site.referrer : utils.getTopWindowReferrer();
let bidData = {
id: utils.generateUUID(),
at: 2,
Expand Down Expand Up @@ -176,7 +176,7 @@ function getRequestData(bid) {
if (bid.params.video.position) {
bidData.imp[0].video.pos = bid.params.video.position
}
if (bid.params.site.id) {
if (bid.params.site && bid.params.site.id) {
bidData.site.id = bid.params.site.id
}
return bidData;
Expand Down

0 comments on commit d1afcd9

Please sign in to comment.