Skip to content

Commit

Permalink
Merge pull request #218 from zestyxyz/same-origin-prebid
Browse files Browse the repository at this point in the history
Add error check in case iframe contentDocument is null
  • Loading branch information
msub2 authored Jun 26, 2024
2 parents 5db5d14 + f6afcc1 commit 7243cb2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions utils/networking.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ const initPrebid = (adUnitId, format) => {
});

function getUrlsFromIframe(iframe) {
if (!iframe.contentDocument) return;

const images = iframe.contentDocument.querySelectorAll('img');
const adImage = Array.prototype.filter.call(images, image => image.height > 1);
if (adImage.length == 0) return;
Expand Down

0 comments on commit 7243cb2

Please sign in to comment.