Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pubads should not be called as a function if undefined #42

Closed
JuanCaicedo opened this issue Sep 17, 2015 · 0 comments
Closed

pubads should not be called as a function if undefined #42

JuanCaicedo opened this issue Sep 17, 2015 · 0 comments

Comments

@JuanCaicedo
Copy link

This conditional

if(!window.googletag || !window.googletag.pubads() || !window.googletag.pubads().getSlots())

does not safely execute. If googletag = {}, then googletag.pubads is undefined. Calling it as a function will throw an error, so the conditional should check that it's a function ahead of time:

(!window.googletag || typeof(window.googletag.pubads) !== 'function' || !window.googletag.pubads() || typeof(window.googletag.pubads().getSlots) !== 'function' || !window.googletag.pubads().getSlots())
nickjacob added a commit that referenced this issue Oct 9, 2015
marian-r added a commit to aol/Prebid.js that referenced this issue Nov 2, 2016
…4.0 to master

* commit '5e7eec42d84ec5de47a28ba493a9357b595761d3':
  CHANGELOG.
  New adapter.
  0.13.1 release
  add an --https flag to run local dev server over https (prebid#670)
  test ie variant of url parse pathname (prebid#669)
  Prevent SpringServe TypeError (prebid#663)
  XDomainRequest does not support `readyState` and was not executing the callback. (prebid#668)
  Prevent Sovrn TypeError (prebid#664)
  Prevent TripleLift TypeError (prebid#662)
  fixed bug with using non standard "standard" keys and sendAllBids (prebid#665)
  Initial value 0 for adder. (prebid#656)
  Prevent bidmanager TypeError (prebid#661)
  Prevent Pubmatic TypeError (prebid#666)
  Size mapping functionality (prebid#651)
  Added '320x80': 59, '320x320': 72, '320x160': 73 to RUBICON_SIZE_MAP (prebid#649)
  Add defy alias + increment version. (prebid#650)
  Add additional sizes to rubicon size mapping (prebid#646)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants