Browse Source

fix: preloader element issue

Torkel Ödegaard 7 years ago
parent
commit
abefadb333
1 changed files with 4 additions and 1 deletions
  1. 4 1
      public/views/index.template.html

+ 4 - 1
public/views/index.template.html

@@ -275,7 +275,10 @@
     document.head.insertBefore(myCSS, document.head.childNodes[document.head.childNodes.length - 1].nextSibling);
     // switch loader to show all has loaded
     window.onload = function() {
-      document.getElementsByClassName("preloader")[0].className = "preloader preloader--done";
+      var preloader = document.getElementsByClassName("preloader");
+      if (preloader.length) {
+        preloader[0].className = "preloader preloader--done";
+      }
     };
   </script>