Fixed Profile Comment for a merged/deleted user generates an error


Well-known member
When doing a search, if the user is merged/deleted, and the profile comment to be orphaned, that search will error when trying to render the results.

The problem is in XenForo_Search_DataHandler_ProfilePostComment::getDataForResults. The path which sets $comment['profileUser'] or removes the comment has a case where it does nether and leaves an invalid profile comment. 'profileUser' is not set if isset($users[$profilePost['profile_user_id']]) is false, this will cause an error when prepareProfilePostComment is called as "$result['profileUser']" is null