Przeglądaj źródła

check outside the loop if thisScript is still null

Amauri CHAMPEAUX 5 lat temu
rodzic
commit
dad64861c6
1 zmienionych plików z 3 dodań i 0 usunięć
  1. 3 0
      tarteaucitron.js

+ 3 - 0
tarteaucitron.js

@@ -8,6 +8,9 @@ for (var i = 0, il = scripts.length; i < il; ++i) {
         thisScript = scripts[i];
         break;
     }
+}
+
+if (thisScript === null) {
     // should never happen
     throw new Error("Error: tarteaucitron.js script not found");
 }