v1.18.x
Julian Lam 10 years ago
parent ee9390ee34
commit 87111ee6be

@ -72,6 +72,11 @@ module.exports = function(Posts) {
});
async.map(posts, function(post, next) {
// If the post author isn't represented in the retrieved users' data, then it means they were deleted, assume guest.
if (!results.users.hasOwnProperty(post.uid)) {
post.uid = 0;
}
post.user = results.users[post.uid];
post.topic = results.topics[post.tid];
post.category = results.categories[post.topic.cid];

@ -57,6 +57,11 @@ module.exports = function(Topics) {
var tidToPost = {};
async.each(postData, function(post, next) {
// If the post author isn't represented in the retrieved users' data, then it means they were deleted, assume guest.
if (!users.hasOwnProperty(post.uid)) {
post.uid = 0;
}
post.user = users[post.uid];
post.timestamp = utils.toISOString(post.timestamp);
tidToPost[post.tid] = post;

Loading…
Cancel
Save