mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
fix: client side crash if there are no topics
This commit is contained in:
@@ -263,6 +263,9 @@ define('forum/category/tools', [
|
||||
}
|
||||
|
||||
function handlePinnedTopicSort() {
|
||||
if (!ajaxify.data.topics) {
|
||||
return;
|
||||
}
|
||||
var numPinned = ajaxify.data.topics.reduce(function (memo, topic) {
|
||||
memo = topic.pinned ? memo += 1 : memo;
|
||||
return memo;
|
||||
|
||||
Reference in New Issue
Block a user