fix: flags detail page crash if reporter blocks author

Fixed an issue where the flags detail page would crash if the
reporting user flagged a post and then proceeded to block the
post author.

Retrieval of a flag's target data should be irrespective of
block status.

fixes #6925
This commit is contained in:
Julian Lam
2018-11-08 13:43:45 -05:00
parent f7bd398eb1
commit d027207f88

View File

@@ -90,7 +90,7 @@ Flags.get = function (flagId, callback) {
// Second stage
async.parallel({
userObj: async.apply(user.getUserFields, data.base.uid, ['username', 'userslug', 'picture', 'reputation']),
targetObj: async.apply(Flags.getTarget, data.base.type, data.base.targetId, data.base.uid),
targetObj: async.apply(Flags.getTarget, data.base.type, data.base.targetId, 0),
}, function (err, payload) {
// Final object return construction
next(err, Object.assign(data.base, {