From 82b9a1005cd5f5d3c338270839a24f217594b35d Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 20 Jan 2022 10:52:50 +0100 Subject: Fix abuse crash on deleted reporter account --- server/models/abuse/abuse-query-builder.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'server') 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' | ] 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) { -- cgit v1.2.3