From 68835844b0d8b2715d9ca84330db3429bae33285 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Wed, 15 Apr 2015 11:27:26 -0400 Subject: [PATCH] crash fix #3031 --- src/topics/follow.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/topics/follow.js b/src/topics/follow.js index c34e15fd96..a266ef150b 100644 --- a/src/topics/follow.js +++ b/src/topics/follow.js @@ -136,11 +136,17 @@ module.exports = function(Topics) { nid: 'tid:' + postData.topic.tid + ':pid:' + postData.pid + ':uid:' + exceptUid, tid: postData.topic.tid, from: exceptUid - }, next); + }, function(err, notification) { + if (err) { + return next(err); + } + if (notification) { + notifications.push(notification, followers); + } + next(); + }); }, - function(notification, next) { - notifications.push(notification, followers); - + function(next) { async.eachLimit(followers, 3, function(toUid, next) { async.parallel({ userData: async.apply(user.getUserFields, toUid, ['username']),