From cca00a655a9c737d8dca5c74f9c8bcc59ebbe3e4 Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 1 Mar 2017 22:33:54 +0900 Subject: [PATCH] [API] Fix bug --- src/api/endpoints/app/create.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/api/endpoints/app/create.js b/src/api/endpoints/app/create.js index 9eb6863a8..8b85da7ff 100644 --- a/src/api/endpoints/app/create.js +++ b/src/api/endpoints/app/create.js @@ -72,8 +72,10 @@ module.exports = async (params, user) => { // Get 'name_id' parameter const nameId = params.name_id; - if (nameId == null || nameId == '') { + if (nameId == null) { return rej('name_id is required'); + } else if (typeof nameId != 'string') { + return rej('name_id must be a string'); } // Validate name_id