From f362758e0aab5c4318c89fb84c49b1fd8434e4df Mon Sep 17 00:00:00 2001 From: fawke Date: Fri, 2 Aug 2019 20:27:28 +0530 Subject: [PATCH] add check to see if adObject is present --- src/secureCreatives.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/secureCreatives.js b/src/secureCreatives.js index f8ba9477b52..df7abe4ebee 100644 --- a/src/secureCreatives.js +++ b/src/secureCreatives.js @@ -31,7 +31,7 @@ function receiveMessage(ev) { return bid.adId === data.adId; }); - if (data.message === 'Prebid Request') { + if (adObject && data.message === 'Prebid Request') { _sendAdToCreative(adObject, data.adServerDomain, ev.source); // save winning bids @@ -45,7 +45,7 @@ function receiveMessage(ev) { // message: 'Prebid Native', // adId: '%%PATTERN:hb_adid%%' // }), '*'); - if (data.message === 'Prebid Native') { + if (adObject && data.message === 'Prebid Native') { if (data.action === 'assetRequest') { const message = getAssetMessage(data, adObject); ev.source.postMessage(JSON.stringify(message), ev.origin);