{"action":"created","issue":{"url":"https://api.github.com/repos/prebid/Prebid.js/issues/3010","repository_url":"https://api.github.com/repos/prebid/Prebid.js","labels_url":"https://api.github.com/repos/prebid/Prebid.js/issues/3010/labels{/name}","comments_url":"https://api.github.com/repos/prebid/Prebid.js/issues/3010/comments","events_url":"https://api.github.com/repos/prebid/Prebid.js/issues/3010/events","html_url":"https://github.com/prebid/Prebid.js/issues/3010","id":353290237,"node_id":"MDU6SXNzdWUzNTMyOTAyMzc=","number":3010,"title":"TypeError: p is null in secureCreatives.js","user":{"login":"iseriousnoob","id":29506275,"node_id":"MDQ6VXNlcjI5NTA2Mjc1","avatar_url":"https://avatars0.githubusercontent.com/u/29506275?v=4","gravatar_id":"","url":"https://api.github.com/users/iseriousnoob","html_url":"https://github.com/iseriousnoob","followers_url":"https://api.github.com/users/iseriousnoob/followers","following_url":"https://api.github.com/users/iseriousnoob/following{/other_user}","gists_url":"https://api.github.com/users/iseriousnoob/gists{/gist_id}","starred_url":"https://api.github.com/users/iseriousnoob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iseriousnoob/subscriptions","organizations_url":"https://api.github.com/users/iseriousnoob/orgs","repos_url":"https://api.github.com/users/iseriousnoob/repos","events_url":"https://api.github.com/users/iseriousnoob/events{/privacy}","received_events_url":"https://api.github.com/users/iseriousnoob/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-08-23T09:06:22Z","updated_at":"2018-08-27T14:08:33Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"## Type of issue: Bug\r\n\r\n## Description\r\nOur logging is catching exceptions. This is really, really rare.\r\n\r\n## secureCreatives.js\r\n\r\n```js\r\nfunction receiveMessage(ev) {\r\n  var key = ev.message ? 'message' : 'data';\r\n  var data = {};\r\n  try {\r\n    data = JSON.parse(ev[key]);\r\n  } catch (e) {\r\n    return;\r\n  }\r\n\r\n  if (data.adId) {\r\n    const adObject = find(auctionManager.getBidsReceived(), function (bid) {\r\n      return bid.adId === data.adId;\r\n    });\r\n\r\n    if (data.message === 'Prebid Request') {\r\n      sendAdToCreative(adObject, data.adServerDomain, ev.source);\r\n\r\n      // save winning bids\r\n      auctionManager.addWinningBid(adObject);\r\n\r\n      events.emit(BID_WON, adObject);\r\n    }\r\n\r\n    // handle this script from native template in an ad server\r\n    // window.parent.postMessage(JSON.stringify({\r\n    //   message: 'Prebid Native',\r\n    //   adId: '%%PATTERN:hb_adid%%'\r\n    // }), '*');\r\n    if (data.message === 'Prebid Native') {\r\n      fireNativeTrackers(data, adObject);\r\n      auctionManager.addWinningBid(adObject);\r\n      events.emit(BID_WON, adObject);\r\n    }\r\n  }\r\n}\r\n```\r\n\r\nI think inside the `if (data.message === 'Prebid Request')`-block data is being overwritten.\r\nResulting in data being null here `if (data.message === 'Prebid Native')`\r\n\r\n## Log\r\n\r\n[https://pastebin.com/raw/kFZaVCWW](https://pastebin.com/raw/kFZaVCWW)\r\n\r\n\r\n## Unminified-Minified Code (cropped)\r\n\r\n```js\r\np = {};\r\ntry {\r\n    p = JSON.parse(e[g])\r\n} catch (e) {\r\n    return\r\n}\r\nif (p.adId) {\r\n\r\n    var m = (0, S.default)(h.auctionManager.getBidsReceived(), function(e) {\r\n        return e.adId === p.adId\r\n    });\r\n    \"Prebid Request\" === p.message && (t = m, n = p.adServerDomain, r = e.source, i = t.adId, o = t.ad, a = t.adUrl, d = t.width, s = t.height, i && (c = (u = t).adUnitCode, f = u.width, l = u.height, [\"div\", \"iframe\"].forEach(function(e) {\r\n        var t, n = (t = e, document.getElementById((0, S.default)(window.googletag.pubads().getSlots().filter((0, y.isSlotMatchingAdUnitCode)(c)), function(e) {\r\n            return e\r\n        }).getSlotElementId()).querySelector(t)).style;\r\n        n.width = f, n.height = l\r\n    }), r.postMessage(JSON.stringify({\r\n        message: \"Prebid Response\",\r\n        ad: o,\r\n        adUrl: a,\r\n        adId: i,\r\n        width: d,\r\n        height: s\r\n    }), n)), h.auctionManager.addWinningBid(m), b.default.emit(A, m)), \"Prebid Native\" === p.message && ((0, v.fireNativeTrackers)(p, m), h.auctionManager.addWinningBid(m), b.default.emit(A, m))\r\n}\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/prebid/Prebid.js/issues/comments/416238964","html_url":"https://github.com/prebid/Prebid.js/issues/3010#issuecomment-416238964","issue_url":"https://api.github.com/repos/prebid/Prebid.js/issues/3010","id":416238964,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNjIzODk2NA==","user":{"login":"jaiminpanchal27","id":7393273,"node_id":"MDQ6VXNlcjczOTMyNzM=","avatar_url":"https://avatars2.githubusercontent.com/u/7393273?v=4","gravatar_id":"","url":"https://api.github.com/users/jaiminpanchal27","html_url":"https://github.com/jaiminpanchal27","followers_url":"https://api.github.com/users/jaiminpanchal27/followers","following_url":"https://api.github.com/users/jaiminpanchal27/following{/other_user}","gists_url":"https://api.github.com/users/jaiminpanchal27/gists{/gist_id}","starred_url":"https://api.github.com/users/jaiminpanchal27/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaiminpanchal27/subscriptions","organizations_url":"https://api.github.com/users/jaiminpanchal27/orgs","repos_url":"https://api.github.com/users/jaiminpanchal27/repos","events_url":"https://api.github.com/users/jaiminpanchal27/events{/privacy}","received_events_url":"https://api.github.com/users/jaiminpanchal27/received_events","type":"User","site_admin":false},"created_at":"2018-08-27T14:08:33Z","updated_at":"2018-08-27T14:08:33Z","author_association":"COLLABORATOR","body":"@iseriousnoob Can you provide steps or test page to reproduce this ?"}}
{"actor":{"display_login":"jaiminpanchal27"}}