1
0
Fork 0

Fix abuse crash on deleted reporter account

This commit is contained in:
Chocobozzz 2022-01-20 10:52:50 +01:00
parent efd4ff5fbc
commit 82b9a1005c
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
2 changed files with 5 additions and 1 deletions

View File

@ -171,6 +171,7 @@ export class AbuseListTableComponent extends RestTable implements OnInit {
isLocalAbuse (abuse: AdminAbuse) {
if (this.viewType === 'user') return true
if (!abuse.reporterAccount) return false
return Actor.IS_LOCAL(abuse.reporterAccount.host)
}

View File

@ -48,7 +48,10 @@ function buildAbuseListQuery (options: BuildAbusesQueryOptions, type: 'count' |
]
if (options.serverAccountId || options.userAccountId) {
whereAnd.push('"abuse"."reporterAccountId" NOT IN (' + buildBlockedAccountSQL([ options.serverAccountId, options.userAccountId ]) + ')')
whereAnd.push(
'"abuse"."reporterAccountId" IS NULL OR ' +
'"abuse"."reporterAccountId" NOT IN (' + buildBlockedAccountSQL([ options.serverAccountId, options.userAccountId ]) + ')'
)
}
if (options.reporterAccountId) {