mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-07 22:45:46 +01:00
user js refactor, category fix
if a category that didn't exist was request with category/1231 or api/category/1231 it was crashing.
This commit is contained in:
@@ -89,6 +89,10 @@ categoriesController.get = function(req, res, next) {
|
||||
end = start + settings.topicsPerPage - 1;
|
||||
|
||||
categories.getCategoryById(cid, start, end, uid, function (err, categoryData) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
|
||||
if (categoryData) {
|
||||
if (parseInt(categoryData.disabled, 10) === 1) {
|
||||
return next(new Error('Category disabled'), null);
|
||||
|
||||
Reference in New Issue
Block a user