mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46: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() {
|
function handlePinnedTopicSort() {
|
||||||
|
if (!ajaxify.data.topics) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
var numPinned = ajaxify.data.topics.reduce(function (memo, topic) {
|
var numPinned = ajaxify.data.topics.reduce(function (memo, topic) {
|
||||||
memo = topic.pinned ? memo += 1 : memo;
|
memo = topic.pinned ? memo += 1 : memo;
|
||||||
return memo;
|
return memo;
|
||||||
|
|||||||
Reference in New Issue
Block a user