if category is not found return

if cid is a child category it wont be on home
This commit is contained in:
barisusakli
2014-11-04 23:55:42 -05:00
parent 70657251b9
commit e5cc45a95b

View File

@@ -31,6 +31,9 @@ define('forum/home', function() {
function renderNewPost(cid, post) {
var category = $('.home .category-item[data-cid="' + cid + '"]');
if (!category.length) {
return;
}
var categoryBox = category.find('.category-box');
var numRecentReplies = category.attr('data-numRecentReplies');
if (!numRecentReplies || !parseInt(numRecentReplies, 10)) {