check outside the loop if thisScript is still null

This commit is contained in:
Amauri CHAMPEAUX 2020-03-27 20:03:42 +01:00
parent 6726dd2e8a
commit dad64861c6
1 changed files with 3 additions and 0 deletions

View File

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