summaryrefslogtreecommitdiff
path: root/src/server/api
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2018-06-08 22:04:22 +0900
committerGitHub <noreply@github.com>2018-06-08 22:04:22 +0900
commit726d5a177efb0fa019f120b1713c8166e9a61aa6 (patch)
treeeb267cac211a43518461c5c1d4103758a2172642 /src/server/api
parent2.33.2 (diff)
parentfix: "or" operator. (diff)
downloadsharkey-726d5a177efb0fa019f120b1713c8166e9a61aa6.tar.gz
sharkey-726d5a177efb0fa019f120b1713c8166e9a61aa6.tar.bz2
sharkey-726d5a177efb0fa019f120b1713c8166e9a61aa6.zip
Merge pull request #1685 from 2vg/patch-1
fix: when text is null, bug can pass validation.
Diffstat (limited to 'src/server/api')
-rw-r--r--src/server/api/endpoints/notes/create.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/server/api/endpoints/notes/create.ts b/src/server/api/endpoints/notes/create.ts
index 182359f637..446764e1d6 100644
--- a/src/server/api/endpoints/notes/create.ts
+++ b/src/server/api/endpoints/notes/create.ts
@@ -140,7 +140,7 @@ module.exports = (params, user: ILocalUser, app: IApp) => new Promise(async (res
}
// テキストが無いかつ添付ファイルが無いかつRenoteも無いかつ投票も無かったらエラー
- if (text === undefined && files === null && renote === null && poll === undefined) {
+ if ((text === undefined || text === null) && files === null && renote === null && poll === undefined) {
return rej('text, mediaIds, renoteId or poll is required');
}