瀏覽代碼

check outside the loop if thisScript is still null

Amauri CHAMPEAUX 5 年之前
父節點
當前提交
dad64861c6
共有 1 個文件被更改,包括 3 次插入0 次删除
  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");
 }