Skip to content

Commit

Permalink
Skip response processing if empty (prebid#11376)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisg93 authored Apr 26, 2024
1 parent c835325 commit 6c0648b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/adyoulikeBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ export const spec = {
const bidResponses = [];
var bidRequests = {};

if (!serverResponse || !serverResponse.body) {
return bidResponses;
}

try {
bidRequests = JSON.parse(request.data).Bids;
} catch (err) {
Expand Down
6 changes: 6 additions & 0 deletions test/spec/modules/adyoulikeBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,12 @@ describe('Adyoulike Adapter', function () {
}
});

it('handles 204 responses', function () {
serverResponse.body = '';
let result = spec.interpretResponse(serverResponse, []);
expect(result).deep.equal([]);
});

it('handles nobid responses', function () {
let response = [{
BidID: '123dfsdf',
Expand Down

0 comments on commit 6c0648b

Please sign in to comment.