fix: ensure result is declared as a constant in mssqlQuery function

pull/5429/head
Antonino Natale 2 weeks ago
parent d3fc87a4b7
commit ae5f8de538

@ -331,7 +331,7 @@ exports.mssqlQuery = async function (connectionString, handleEmptyResult, query)
if (!query) { if (!query) {
query = "SELECT 1"; query = "SELECT 1";
} }
result = await pool.request().query(query); const result = await pool.request().query(query);
if (Array.isArray(result.recordset)) { if (Array.isArray(result.recordset)) {
if (handleEmptyResult && result.recordset.length === 0) { if (handleEmptyResult && result.recordset.length === 0) {
throw new Error("No rows returned"); throw new Error("No rows returned");

Loading…
Cancel
Save