updates to stop it breaking with an empty table

This commit is contained in:
Martin Donnelly 2016-02-24 15:09:10 +00:00
parent fa8e7bb26d
commit 17435af10a

View File

@ -138,7 +138,7 @@ router.get('/list', function (req, res) {
var out = [];
if (rows !== null && rows.length > 0) {
if (rows !== null && typeof rows !== 'undefined') {
// logger.debug(err);
// logger.debug(rows);
rows.forEach(function (row) {
@ -165,7 +165,7 @@ router.get('/entry/:id', function (req, res) {
var out = [];
// logger.debug(err);
// logger.debug(rows);
if (rows !== null && rows.length > 0)
if (rows !== null && typeof rows !== 'undefined') {
{
rows.forEach(function (row) {