Skip to content

Commit

Permalink
Prebid Core: fix typeerror from reading properties of undefined ('get…
Browse files Browse the repository at this point in the history
…SlotElementId') (prebid#7890)

* fix: Webpack v5 complain about named export from JSON modules

* Index Exchange Adapter: fix "Should not import the named export 'EVENTS'.'AUCTION_DEBUG' (imported as 'EVENTS') from default-exporting module (only default export is available soon)""

* fix: Uncaught TypeError: Cannot read properties of undefined (reading 'getSlotElementId')

* fix: Uncaught TypeError: Cannot read properties of undefined (reading 'getSlotElementId')

Co-authored-by: Javier Marín <[email protected]>
  • Loading branch information
2 people authored and Chris Pabst committed Jan 10, 2022
1 parent 9cfc317 commit c614c2c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/secureCreatives.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,12 @@ function resizeRemoteCreative({ adId, adUnitCode, width, height }) {
}

function getDfpElementId(adId) {
return find(window.googletag.pubads().getSlots(), slot => {
const slot = find(window.googletag.pubads().getSlots(), slot => {
return find(slot.getTargetingKeys(), key => {
return includes(slot.getTargeting(key), adId);
});
}).getSlotElementId();
});
return slot ? slot.getSlotElementId() : null;
}

function getAstElementId(adUnitCode) {
Expand Down

0 comments on commit c614c2c

Please sign in to comment.