From 43bca8ed38156fc15c9e7a41ee0df08f14163db3 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Sun, 19 Mar 2023 20:03:49 -0700 Subject: [PATCH] validate blank messages on backend --- .../src/server/api/endpoints/messaging/messages/create.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/src/server/api/endpoints/messaging/messages/create.ts b/packages/backend/src/server/api/endpoints/messaging/messages/create.ts index 99d392ce45..03d762e977 100644 --- a/packages/backend/src/server/api/endpoints/messaging/messages/create.ts +++ b/packages/backend/src/server/api/endpoints/messaging/messages/create.ts @@ -151,7 +151,7 @@ export default define(meta, paramDef, async (ps, user) => { } // テキストが無いかつ添付ファイルも無かったらエラー - if (ps.text == null && file == null) { + if ((ps.text == null || ps.text.trim() === '') && file == null) { throw new ApiError(meta.errors.contentRequired); }