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

@@ -31,7 +31,7 @@ Categories.getCategoryById = function (data, callback) {
Categories.getCategories([data.cid], data.uid, next);
},
function (categories, next) {
if (!Array.isArray(categories) || !categories[0]) {
if (!categories[0]) {
return next(new Error('[[error:invalid-cid]]'));
}
category = categories[0];