mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-05-06 10:36:15 +02: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