diff --git a/docs/static/js/carbon.js b/docs/static/js/carbon.js index f18744a2..4b7ebae2 100644 --- a/docs/static/js/carbon.js +++ b/docs/static/js/carbon.js @@ -1,17 +1,20 @@ (function () { function attachAd() { - var el = document.createElement('script'); - el.setAttribute('type', 'text/javascript'); - el.setAttribute('id', '_carbonads_js'); - el.setAttribute( - 'src', - '//cdn.carbonads.com/carbon.js?serve=CESI65QJ&placement=taskfiledev' - ); - el.setAttribute('async', 'async'); - var wrapper = document.getElementById('sidebar-ads'); - wrapper.innerHTML = ''; - wrapper.appendChild(el); + if (wrapper) { + + var el = document.createElement('script'); + el.setAttribute('type', 'text/javascript'); + el.setAttribute('id', '_carbonads_js'); + el.setAttribute( + 'src', + '//cdn.carbonads.com/carbon.js?serve=CESI65QJ&placement=taskfiledev' + ); + el.setAttribute('async', 'async'); + + wrapper.innerHTML = ''; + wrapper.appendChild(el); + } } setTimeout(function () {