From 61823e7689fcdec71a5119a6c246eada9f5ed450 Mon Sep 17 00:00:00 2001 From: muxator Date: Wed, 29 Aug 2018 02:28:40 +0200 Subject: [PATCH] db/AuthorManager: early return, no functional changes --- src/node/db/AuthorManager.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/node/db/AuthorManager.js b/src/node/db/AuthorManager.js index 5f48e19d..c7ebf47f 100644 --- a/src/node/db/AuthorManager.js +++ b/src/node/db/AuthorManager.js @@ -209,20 +209,19 @@ exports.listPadsOfAuthor = function (authorID, callback) if(author == null) { callback(new customError("authorID does not exist","apierror")) + return; } + //everything is fine, return the pad IDs - else + var pads = []; + if(author.padIDs != null) { - var pads = []; - if(author.padIDs != null) + for (var padId in author.padIDs) { - for (var padId in author.padIDs) - { - pads.push(padId); - } + pads.push(padId); } - callback(null, {padIDs: pads}); } + callback(null, {padIDs: pads}); }); }