From 4f0bb70118818bd562b4d666f961cf465748601b Mon Sep 17 00:00:00 2001 From: danominium <37584143+danominium@users.noreply.github.com> Date: Tue, 7 Mar 2023 20:09:20 +0900 Subject: [PATCH] =?UTF-8?q?fix(backend):=20=E3=83=96=E3=83=AD=E3=83=83?= =?UTF-8?q?=E3=82=AF=E3=83=9B=E3=82=B9=E3=83=88=E3=81=8C=E3=81=AA=E3=81=84?= =?UTF-8?q?=E5=A0=B4=E5=90=88=E3=81=AFIN=E3=82=AF=E3=82=A8=E3=83=AA?= =?UTF-8?q?=E3=82=92=E7=94=9F=E6=88=90=E3=81=97=E3=81=AA=E3=81=84=E3=80=82?= =?UTF-8?q?=20(#10258)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 空のINクエリはシンタックスエラーとなるため。 --- .../backend/src/server/api/endpoints/federation/instances.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/server/api/endpoints/federation/instances.ts b/packages/backend/src/server/api/endpoints/federation/instances.ts index 60b24e9585..3d7bd8b429 100644 --- a/packages/backend/src/server/api/endpoints/federation/instances.ts +++ b/packages/backend/src/server/api/endpoints/federation/instances.ts @@ -76,9 +76,9 @@ export default class extends Endpoint { if (typeof ps.blocked === 'boolean') { const meta = await this.metaService.fetch(true); if (ps.blocked) { - query.andWhere('instance.host IN (:...blocks)', { blocks: meta.blockedHosts }); + query.andWhere(meta.blockedHosts.length === 0 ? '1=0': 'instance.host IN (:...blocks)', { blocks: meta.blockedHosts }); } else { - query.andWhere('instance.host NOT IN (:...blocks)', { blocks: meta.blockedHosts }); + query.andWhere(meta.blockedHosts.length === 0 ? '1=1': 'instance.host NOT IN (:...blocks)', { blocks: meta.blockedHosts }); } }