diff static/js/download.js @ 483:0978d4880577

downloads: skip trying to fill in button if it's not there
author Kevin Bullock <kbullock+mercurial@ringworld.org>
date Sun, 14 May 2017 21:15:12 -0500
parents 1188817fdf3a
children
line wrap: on
line diff
--- a/static/js/download.js	Sun May 14 22:01:40 2017 -0500
+++ b/static/js/download.js	Sun May 14 21:15:12 2017 -0500
@@ -135,10 +135,16 @@
 
 (function (document, window) {
     var load = function () {
+        var versElement = document.getElementById('download-version')
+          , descElement = document.getElementById('download-description');
+
+        if (!(versElement && descElement)) {
+            return;
+        }
+
         Downloader.init(sources);
         window.dl = Downloader.select();
-        var versElement = document.getElementById('download-version')
-          , descElement = document.getElementById('download-description');
+
         versElement.appendChild(document.createTextNode(dl.attr('version')));
         descElement.appendChild(document.createTextNode(dl.attr('desc')));
     }