summaryrefslogtreecommitdiff
path: root/src/api/endpoints
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-02-14 14:47:59 +0900
committersyuilo <syuilotan@yahoo.co.jp>2017-02-14 14:47:59 +0900
commit9c385214bd23c673dc3b8a8124ca10b9afc6dafe (patch)
tree2754676b1670f45687216081b518ad0f74001075 /src/api/endpoints
parentMerge branch 'master' of https://github.com/syuilo/misskey (diff)
downloadsharkey-9c385214bd23c673dc3b8a8124ca10b9afc6dafe.tar.gz
sharkey-9c385214bd23c673dc3b8a8124ca10b9afc6dafe.tar.bz2
sharkey-9c385214bd23c673dc3b8a8124ca10b9afc6dafe.zip
[API] Fix bug
Diffstat (limited to 'src/api/endpoints')
-rw-r--r--src/api/endpoints/posts/create.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/api/endpoints/posts/create.js b/src/api/endpoints/posts/create.js
index 61f8e714fb..607867403a 100644
--- a/src/api/endpoints/posts/create.js
+++ b/src/api/endpoints/posts/create.js
@@ -174,6 +174,11 @@ module.exports = (params, user, app) =>
return rej('poll choices must be an array');
}
+ // 選択肢が空の配列でエラー
+ if (poll.choices.length == 0) {
+ return rej('poll choices is required');
+ }
+
// Validate each choices
const shouldReject = poll.choices.some(choice => {
if (typeof choice !== 'string') return true;