In Nodebb 1.10.1
When viewing a flag detail page the forum crashes because the reporter has blocked the person being reported.
modsController.flags.detail ->
flags.get (in src/flags.js) ->
Flags.getTarget (in src/flags.js) ->
posts.getPostsByPids (in src/posts.js) ->
user.blocks.filter (which filters out the reported post causing getPostsByPids to return empty postData) ->
topics.addPostData (in src/posts.js - which returns undefined) ->
causes the Object.keys function below to produce this error "Cannot convert undefined or null to object"
:man_facepalming:
Just to clarify, this occurs when the moderator viewing the page has blocked the reported individual, right?
No when the reporter of the flagged post has blocked the poster of the post. When doing getPostsByPids it uses data.base.uid which is the reporter of the flag. Though which ever uid you use, if they have them blocked then the same issue will occur
Most helpful comment
:man_facepalming: