Skip to content

Commit

Permalink
Update SQL params. Ensure Array type
Browse files Browse the repository at this point in the history
  • Loading branch information
RobAndrewHurst committed Jan 20, 2025
1 parent 93e95d6 commit 51d63c4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mod/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,11 @@ An error will be returned if the substitution fails.
*/
function getQueryFromTemplate(req, template) {
try {
//Esure that the SQL param is an array
if (!Array.isArray(req.params.SQL)) {
req.params.SQL = [];
}

if (typeof template.render === 'function') {
// Render template string from template.render() function.
template.template = template.render(req.params);
Expand Down

0 comments on commit 51d63c4

Please sign in to comment.