mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-19 21:17:54 +01:00
handling errors :rage2:
This commit is contained in:
@@ -273,6 +273,10 @@ module.exports = function(Posts) {
|
||||
var prop;
|
||||
|
||||
Posts.getPostData(pid, function(err, postData) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
// Track new additions
|
||||
for(prop in flagObj) {
|
||||
if (flagObj.hasOwnProperty(prop) && !postData.hasOwnProperty('flag:' + prop)) {
|
||||
@@ -378,6 +382,10 @@ module.exports = function(Posts) {
|
||||
next(err, event);
|
||||
})
|
||||
}, function(err, history) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
|
||||
post['flag:history'] = history;
|
||||
next(null, post);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user