From f6c1d65c89e38dbeb8a4c469aacb4cb78f6ee4c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ton=C4=87i=20Vatavuk?= Date: Mon, 10 Nov 2025 14:00:02 +0100 Subject: [PATCH] Refactor includeScript to initialize script as null fixes #5791 --- Oqtane.Server/wwwroot/js/interop.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Oqtane.Server/wwwroot/js/interop.js b/Oqtane.Server/wwwroot/js/interop.js index ab29231b..944f9812 100644 --- a/Oqtane.Server/wwwroot/js/interop.js +++ b/Oqtane.Server/wwwroot/js/interop.js @@ -124,7 +124,7 @@ Oqtane.Interop = { } }, includeScript: function (id, src, integrity, crossorigin, type, content, location, dataAttributes) { - var script; + var script = null; if (src !== "") { script = document.querySelector("script[src=\"" + CSS.escape(src) + "\"]"); } @@ -140,7 +140,7 @@ Oqtane.Interop = { } } } - if (script !== null) { + if (script instanceof HTMLScriptElement) { script.remove(); script = null; }