Skip to content

Commit

Permalink
Get Bid Type For Adjustments Bug Fix (#2767)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexBVolcy committed May 10, 2023
1 parent e7d5cb8 commit ee7b8f1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion exchange/bidder.go
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ func getBidTypeForAdjustments(bidType openrtb_ext.BidType, impID string, imp []o
if bidType == openrtb_ext.BidTypeVideo {
for _, imp := range imp {
if imp.ID == impID {
if imp.Video.Plcmt == adcom1.VideoPlcmtAccompanyingContent {
if imp.Video != nil && imp.Video.Plcmt == adcom1.VideoPlcmtAccompanyingContent {
return "video-outstream"
}
break
Expand Down
11 changes: 11 additions & 0 deletions exchange/bidder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3036,6 +3036,17 @@ func TestGetBidType(t *testing.T) {
givenImpId: "imp-id",
expected: string(openrtb_ext.BidTypeBanner),
},
{
name: "VideoBidTypeImpVideoIsNil",
givenImp: []openrtb2.Imp{
{
ID: "imp-id",
},
},
givenBidType: openrtb_ext.BidTypeVideo,
givenImpId: "imp-id",
expected: "video-instream",
},
}

for _, test := range testCases {
Expand Down

0 comments on commit ee7b8f1

Please sign in to comment.