From a585ba54807138efea792a70171a7e8b5051a14b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Fri, 17 Nov 2017 18:07:19 +0100 Subject: [PATCH] Use early retutn node pattern --- lib/cartodb/controllers/analyses.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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(); } ); };