if category doesn't exist return null and 404
This commit is contained in:
Barış Soner Uşaklı
2018-12-01 17:15:38 -05:00
parent ec0c50d4e0
commit a63ddbe2aa
4 changed files with 22 additions and 5 deletions

View File

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