Skip to content

Commit

Permalink
added validation for ads.status
Browse files Browse the repository at this point in the history
  • Loading branch information
hjeong12 committed Dec 8, 2015
1 parent 66cbea9 commit 0bfcfa7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/adapters/rubicon.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ var RubiconAdapter = function RubiconAdapter() {
iframeId = bidObj.iframeId;
}

bid = bidfactory.createBid(1);
if (response.ads && response.ads[0] && response.ads[0].status === 'ok') {
bid = bidfactory.createBid(1);

if (response.ads && response.ads[0]) {
var rubiconAd = response.ads[0];
var size = sizeMap[rubiconAd.size_id];
var width = 0;
Expand Down Expand Up @@ -148,6 +148,14 @@ var RubiconAdapter = function RubiconAdapter() {
bid.sizeId = rubiconAd.size_id;
bid.width = width;
bid.height = height;

}else{
bid = bidfactory.createBid(2);
bid.bidderCode = 'rubicon';
var bidObj = bidmanager.getPlacementIdByCBIdentifer(getBidId(response));
if (bidObj) {
placementCode = bidObj.placementCode;
}
}

} catch (e) {
Expand Down

0 comments on commit 0bfcfa7

Please sign in to comment.