mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-06 12:31:33 +01:00
check result for null
This commit is contained in:
@@ -279,12 +279,7 @@ var path = require('path'),
|
||||
return callback(err, null);
|
||||
}
|
||||
|
||||
posts.getPostSummaryByPids(pids, false, function (err, posts) {
|
||||
if (err){
|
||||
return callback(err, null);
|
||||
}
|
||||
callback(null, posts);
|
||||
});
|
||||
posts.getPostSummaryByPids(pids, false, callback);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -294,12 +289,7 @@ var path = require('path'),
|
||||
return callback(err, null);
|
||||
}
|
||||
|
||||
topics.getTopicsByTids(tids, 0, 0, function (err, topics) {
|
||||
if (err){
|
||||
return callback(err, null);
|
||||
}
|
||||
callback(null, topics);
|
||||
});
|
||||
topics.getTopicsByTids(tids, 0, 0, callback);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -309,6 +299,10 @@ var path = require('path'),
|
||||
return next(err);
|
||||
}
|
||||
|
||||
if(!results) {
|
||||
results[0] = results[1] = [];
|
||||
}
|
||||
|
||||
return res.json({
|
||||
show_no_topics: results[1].length ? 'hide' : '',
|
||||
show_no_posts: results[0].length ? 'hide' : '',
|
||||
|
||||
Reference in New Issue
Block a user