fixing issue where navigating to a non-existant category_id caused NodeBB

to crash
This commit is contained in:
Julian Lam
2013-07-22 20:29:51 -04:00
parent 741a5843a1
commit 9e7afcf0ab
4 changed files with 22 additions and 18 deletions

View File

@@ -67,7 +67,12 @@
};
Feed.updateCategory = function(cid) {
categories.getCategoryById(cid, 0, function(categoryData) {
categories.getCategoryById(cid, 0, function(err, categoryData) {
if (err) {
console.log('Error: Could not update RSS feed for category ' + cid);
return;
}
var location = '/category/' + categoryData.category_id + '/' + categoryData.category_name,
xml_url = '/category' + cid + '.rss';