diff --git a/src/routes/apps.js b/src/routes/apps.js index 24a9acfb5..da3570dda 100644 --- a/src/routes/apps.js +++ b/src/routes/apps.js @@ -346,7 +346,7 @@ function exec(req, res, next) { var cmd = null; if (req.query.cmd) { cmd = safe.JSON.parse(req.query.cmd); - if (!util.isArray(cmd) && cmd.length < 1) return next(new HttpError(400, 'cmd must be array with atleast size 1')); + if (!util.isArray(cmd) || cmd.length < 1) return next(new HttpError(400, 'cmd must be array with atleast size 1')); } var columns = req.query.columns ? parseInt(req.query.columns, 10) : null;