From f17ed8e2f003d4712c3e7276bc0fd4fe15857301 Mon Sep 17 00:00:00 2001 From: Michael Burns Date: Thu, 23 Sep 2021 11:12:37 -0400 Subject: [PATCH] Fix inf loop (#7460) --- modules/ixBidAdapter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ixBidAdapter.js b/modules/ixBidAdapter.js index 8f821e87911..4ff84e7c104 100644 --- a/modules/ixBidAdapter.js +++ b/modules/ixBidAdapter.js @@ -638,7 +638,7 @@ function buildRequest(validBidRequests, bidderRequest, impressions, version) { let currentImpressionSize = encodeURIComponent(JSON.stringify({ impressionObjects })).length; - while (currentImpressionSize > remainingRequestSize) { + while (impressionObjects.length && currentImpressionSize > remainingRequestSize) { wasAdUnitImpressionsTrimmed = true; impressionObjects.pop(); currentImpressionSize = encodeURIComponent(JSON.stringify({ impressionObjects })).length;