Browse Source

Combine !linkElement & !linkElement.href condition in isPreloadable

Alexandre Dieulot 6 years ago
parent
commit
1c527d9059
1 changed files with 1 additions and 5 deletions
  1. 1 5
      instantpage.js

+ 1 - 5
instantpage.js

@@ -81,11 +81,7 @@ function mouseoutListener(event) {
 }
 }
 
 
 function isPreloadable(linkElement) {
 function isPreloadable(linkElement) {
-  if (!linkElement) {
-    return
-  }
-
-  if (!linkElement.href) {
+  if (!linkElement || !linkElement.href) {
     return
     return
   }
   }