FIX: prevents crash if flagger doesn’t exist (#6219)

This commit is contained in:
Joffrey JAFFEUX 2018-07-31 23:48:54 -04:00 committed by GitHub
parent 849f0d00f6
commit 5febe71baa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -1015,9 +1015,11 @@ class Report
data[:poster_avatar_template] = User.avatar_template(row.poster_username, row.poster_avatar_id)
end
data[:flagger_id] = row.flagger_id
data[:flagger_username] = row.flagger_username
data[:flagger_avatar_template] = User.avatar_template(row.flagger_username, row.flagger_avatar_id)
if row.flagger_id
data[:flagger_id] = row.flagger_id
data[:flagger_username] = row.flagger_username
data[:flagger_avatar_template] = User.avatar_template(row.flagger_username, row.flagger_avatar_id)
end
if row.agreed_by_id
data[:resolution] = I18n.t("reports.flags_status.values.agreed")