diff --git a/lib/cartodb/controllers/analyses.js b/lib/cartodb/controllers/analyses.js index 5d6ac238..a977c854 100644 --- a/lib/cartodb/controllers/analyses.js +++ b/lib/cartodb/controllers/analyses.js @@ -92,11 +92,11 @@ AnalysesController.prototype.catalog = function (req, res, next) { err.http_status = 401; } - next(err); - } else { - res.body = { catalog: catalogWithTables }; - next(); + return next(err); } + + res.body = { catalog: catalogWithTables }; + next(); } ); };