remove unnecessary checks

This commit is contained in:
Barış Soner Uşaklı
2017-05-27 00:47:04 -04:00
parent f1b8492164
commit bcc566fb68
7 changed files with 4 additions and 17 deletions

View File

@@ -314,7 +314,7 @@ topicsController.teaser = function (req, res, next) {
posts.getPostSummaryByPids([pid], req.uid, { stripTags: false }, next);
},
function (posts) {
if (!Array.isArray(posts) || !posts.length) {
if (!posts.length) {
return res.status(404).json('not-found');
}
res.json(posts[0]);