From 58b8c32fe993debf4331418f77174f07c785f71d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Fri, 29 May 2015 00:47:37 -0400 Subject: [PATCH] crash fix --- src/topics/teaser.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 +};