Bläddra i källkod

Combine !linkElement & !linkElement.href condition in isPreloadable

Alexandre Dieulot 6 år sedan
förälder
incheckning
1c527d9059
1 ändrade filer med 1 tillägg och 5 borttagningar
  1. 1 5
      instantpage.js

+ 1 - 5
instantpage.js

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