소스 검색

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");
 }