Skip to content

Commit

Permalink
Fix: add site.publisher nil check
Browse files Browse the repository at this point in the history
  • Loading branch information
bsardo committed Jul 25, 2024
1 parent 83bce5a commit 8ff11b6
Showing 4 changed files with 66 additions and 38 deletions.
2 changes: 1 addition & 1 deletion adapters/triplelift_native/triplelift_native.go
Original file line number Diff line number Diff line change
@@ -75,7 +75,7 @@ func processImp(imp *openrtb2.Imp, request *openrtb2.BidRequest) error {
}

if extData.TagCode != "" {
if siteCopy.Publisher.Domain == "msn.com" {
if siteCopy.Publisher != nil && siteCopy.Publisher.Domain == "msn.com" {
imp.TagID = extData.TagCode
} else {
imp.TagID = tlext.InvCode
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"mockBidRequest": {
"id": "test-request-id",
"app": {
"publisher": {
"ext": {
"prebid": {
"parentAccount": "faz"
}
},
"id": "far",
"name": "bar"
}
},
"imp": [{
"id": "test-imp-id",
"banner": {
"format": [{
"w": 300,
"h": 250
},
{
"w": 300,
"h": 600
}
]
},
"ext": {
"bidder": {
"inventoryCode": "foo",
"floor": 20
}
}
}]
},
"expectedMakeRequestsErrors": [{
"value": "Unsupported publisher for triplelift_native",
"comparison": "literal"
}]
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"mockBidRequest": {
"id": "test-request-id",
"site": {},
"imp": [{
"native": {
"request": "{\"plcmtcnt\":1,\"plcmttype\":2,\"privacy\":1,\"context\":1,\"contextsubtype\":12,\"eventtrackers\":[{\"event\":1,\"methods\":[1,2]},{\"event\":2,\"methods\":[1]}],\"assets\":[{\"data\":{\"type\":12},\"required\":1},{\"title\":{\"len\":50},\"required\":1},{\"img\":{\"w\":80,\"h\":80,\"type\":1},\"required\":1},{\"img\":{\"w\":1200,\"h\":627,\"type\":3},\"required\":1},{\"data\":{\"type\":3},\"required\":0},{\"data\":{\"len\":100,\"type\":2},\"required\":1},{\"video\":{\"mimes\":[\"video/mpeg\",\"video/mp4\"],\"minduration\":2,\"protocols\":[2,5],\"maxduration\":2,\"ext\":{\"playbackmethod\":[1,2]}},\"required\":1}],\"ver\":\"1.2\"}"
},
"id": "test-imp-id",
"ext": {
"bidder": {
"inventoryCode": "foo",
"floor": 20
},
"data": {
"tag_code": "bar"
}
}
}]
},
"expectedMakeRequestsErrors": [{
"value": "Unsupported publisher for triplelift_native",
"comparison": "literal"
}]
}

0 comments on commit 8ff11b6

Please sign in to comment.