From e5cc45a95bff10ab4759cc5905d7ff0c51e6617c Mon Sep 17 00:00:00 2001 From: barisusakli Date: Tue, 4 Nov 2014 23:55:42 -0500 Subject: [PATCH] if category is not found return if cid is a child category it wont be on home --- public/src/client/home.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/public/src/client/home.js b/public/src/client/home.js index 013c351176..ca18223881 100644 --- a/public/src/client/home.js +++ b/public/src/client/home.js @@ -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)) {