Quellcode durchsuchen

Combine !linkElement & !linkElement.href condition in isPreloadable

Alexandre Dieulot vor 6 Jahren
Ursprung
Commit
1c527d9059
1 geänderte Dateien mit 1 neuen und 5 gelöschten Zeilen
  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
   }