This commit is contained in:
Julian Lam
2015-07-24 10:22:21 -04:00
parent ee9390ee34
commit 87111ee6be
2 changed files with 10 additions and 0 deletions

View File

@@ -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];