Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Fix abuse crash on deleted reporter account

Chocobozzz82b9a1005cd5
diff --git a/client/src/app/shared/shared-abuse-list/abuse-list-table.component.ts b/client/src/app/shared/shared-abuse-list/abuse-list-table.component.ts
index 08cf297ccf..8781c16f5c 100644
--- a/client/src/app/shared/shared-abuse-list/abuse-list-table.component.ts
+++ b/client/src/app/shared/shared-abuse-list/abuse-list-table.component.ts
@@ -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)
}
diff --git a/server/models/abuse/abuse-query-builder.ts b/server/models/abuse/abuse-query-builder.ts
index 5324591444..025e6ba553 100644
--- a/server/models/abuse/abuse-query-builder.ts
+++ b/server/models/abuse/abuse-query-builder.ts
@@ -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) {