mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-05-07 19:27:11 +02:00
Handle callback errors
This commit is contained in:
@@ -106,6 +106,10 @@ module.exports = function(Posts) {
|
||||
async.series([
|
||||
function(next) {
|
||||
db.getSortedSetRange('pid:' + pid + ':flag:uids', 0, -1, function(err, uids) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
|
||||
async.each(uids, function(uid, next) {
|
||||
var nid = 'post_flag:' + pid + ':uid:' + uid;
|
||||
async.parallel([
|
||||
|
||||
@@ -101,6 +101,10 @@ module.exports = function(Posts) {
|
||||
next(null, post);
|
||||
});
|
||||
}, function(err, posts) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
plugins.fireHook('filter:post.getPostSummaryByPids', {posts: posts, uid: uid}, function(err, postData) {
|
||||
callback(err, postData.posts);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user