From dad64861c6668d20ce144f8e9dfec9435e05f63f Mon Sep 17 00:00:00 2001 From: Amauri CHAMPEAUX Date: Fri, 27 Mar 2020 20:03:42 +0100 Subject: [PATCH] check outside the loop if thisScript is still null --- tarteaucitron.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tarteaucitron.js b/tarteaucitron.js index ff304fc..b4d09ff 100644 --- a/tarteaucitron.js +++ b/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"); }