From 7420f6ce568376fa1a82be72026fdc4d664dacc4 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 99d392ce4..03d762e97 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); }