Skip to content
This repository has been archived by the owner on Nov 26, 2021. It is now read-only.

Commit

Permalink
Bugfix: bail if startAds method is called multiple times (V3) (#108)
Browse files Browse the repository at this point in the history
* Bugfix: bail if startAds method is called multiple times

* Check loading spinner exists before attempting to remove it
  • Loading branch information
i-like-robots authored Jun 20, 2017
1 parent 924a8d6 commit c6780ed
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/js/ads.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,10 @@ class VideoAds {
}

// Remove the preloading spinner
this.loadingStateEl.parentNode.removeChild(this.loadingStateEl);
this.loadingStateEl = null;
if (this.loadingStateEl) {
this.loadingStateEl.parentNode.removeChild(this.loadingStateEl);
this.loadingStateEl = null;
}

try {
// Initialize the ads manager. Ad rules playlist will start at this time.
Expand Down

0 comments on commit c6780ed

Please sign in to comment.