aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/abuse/abuse-query-builder.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-01-20 10:52:50 +0100
committerChocobozzz <me@florianbigard.com>2022-01-20 10:52:50 +0100
commit82b9a1005cd5f5d3c338270839a24f217594b35d (patch)
treeef3dbcff6a9024823b11b68cdb58e7cefc003d5c /server/models/abuse/abuse-query-builder.ts
parentefd4ff5fbcd1e557c3c8af25b8b8ee5b3a2e9f0d (diff)
downloadPeerTube-82b9a1005cd5f5d3c338270839a24f217594b35d.tar.gz
PeerTube-82b9a1005cd5f5d3c338270839a24f217594b35d.tar.zst
PeerTube-82b9a1005cd5f5d3c338270839a24f217594b35d.zip
Fix abuse crash on deleted reporter account
Diffstat (limited to 'server/models/abuse/abuse-query-builder.ts')
-rw-r--r--server/models/abuse/abuse-query-builder.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/server/models/abuse/abuse-query-builder.ts b/server/models/abuse/abuse-query-builder.ts
index 532459144..025e6ba55 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' |
48 ] 48 ]
49 49
50 if (options.serverAccountId || options.userAccountId) { 50 if (options.serverAccountId || options.userAccountId) {
51 whereAnd.push('"abuse"."reporterAccountId" NOT IN (' + buildBlockedAccountSQL([ options.serverAccountId, options.userAccountId ]) + ')') 51 whereAnd.push(
52 '"abuse"."reporterAccountId" IS NULL OR ' +
53 '"abuse"."reporterAccountId" NOT IN (' + buildBlockedAccountSQL([ options.serverAccountId, options.userAccountId ]) + ')'
54 )
52 } 55 }
53 56
54 if (options.reporterAccountId) { 57 if (options.reporterAccountId) {