Skip to content

Commit

Permalink
fix: client side crash if there are no topics
Browse files Browse the repository at this point in the history
  • Loading branch information
barisusakli committed Sep 13, 2020
1 parent 21ae81b commit a8e18fd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions public/src/client/category/tools.js
Expand Up @@ -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;
Expand Down

0 comments on commit a8e18fd

Please sign in to comment.