From ae5f8de5385a75f1690eb5d240d485ffe4b6b719 Mon Sep 17 00:00:00 2001 From: Antonino Natale Date: Tue, 10 Dec 2024 23:19:39 +0100 Subject: [PATCH] fix: ensure result is declared as a constant in mssqlQuery function --- server/util-server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/util-server.js b/server/util-server.js index 9af557c5d..5fa2d810b 100644 --- a/server/util-server.js +++ b/server/util-server.js @@ -331,7 +331,7 @@ exports.mssqlQuery = async function (connectionString, handleEmptyResult, query) if (!query) { query = "SELECT 1"; } - result = await pool.request().query(query); + const result = await pool.request().query(query); if (Array.isArray(result.recordset)) { if (handleEmptyResult && result.recordset.length === 0) { throw new Error("No rows returned");