diff --git a/index.js b/index.js index 52c0e73..1b1dca5 100644 --- a/index.js +++ b/index.js @@ -39,8 +39,12 @@ Postgres.FirstRow = function(inSQL, args, inResponse) { if (err === null) { //need to test if the response is an object or an array //inResponse.json(res.rows[0]); - //if (Array.isArray(res)) {} - inResponse.json(res[1].rows[0]); + if (Array.isArray(res)) { + inResponse.json(res[1].rows[0]); + } + else { + inResponse.json(res.rows[0]); + } return; } console.log(err.stack);