Skip to content

Commit

Permalink
replace hasOwnProperty with more reliable check
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul-Hess committed Jun 5, 2018
1 parent 60f6ce0 commit 8826ee3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/createManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,11 @@ export class AdManager extends EventEmitter {
instance.defineSlot();
const adSlot = instance.adSlot;

if (adSlot && adSlot.hasOwnProperty("getServices")) {
if (
adSlot &&
adSlot.getServices &&
typeof adSlot.getServices === "function"
) {
const services = adSlot.getServices();
if (!hasPubAdsService) {
hasPubAdsService =
Expand Down

0 comments on commit 8826ee3

Please sign in to comment.