diff --git a/src/topics/teaser.js b/src/topics/teaser.js index 4574151554..6440536ce1 100644 --- a/src/topics/teaser.js +++ b/src/topics/teaser.js @@ -61,6 +61,9 @@ module.exports = function(Topics) { return callback(err); } var teasers = topics.map(function(topic, index) { + if (!topic) { + return null; + } if (tidToPost[topic.tid]) { tidToPost[topic.tid].index = counts[index]; if (tidToPost[topic.tid].content) { @@ -109,4 +112,4 @@ module.exports = function(Topics) { Topics.setTopicField(tid, 'teaserPid', pid, callback); }); }; -}; \ No newline at end of file +};