Skip to content

Commit

Permalink
Better console message when message.source is null (ampproject#24977)
Browse files Browse the repository at this point in the history
  • Loading branch information
lannka authored and Micajuine Ho committed Dec 27, 2019
1 parent 596b9f1 commit 1c3c58a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ads/inabox/inabox-host.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,10 @@ export class InaboxHost {
function validateMessage(message) {
const valid = !!(message.source && message.source.postMessage);
if (!valid) {
user().error(
user().warn(
TAG,
'Missing message.source. message.data=' + JSON.stringify(getData(message))
'Ignoring an inabox message. Likely the requester iframe has been removed. message.data=' +
JSON.stringify(getData(message))
);
}
return valid;
Expand Down

0 comments on commit 1c3c58a

Please sign in to comment.