summaryrefslogtreecommitdiff
path: root/src/api/endpoints/i
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-03-01 20:38:27 +0900
committersyuilo <syuilotan@yahoo.co.jp>2017-03-01 20:38:27 +0900
commit93c3faf141c1927a390b2e22169cad90a6a628ed (patch)
tree0218f08630a4d9b86551edc9c01ab9697a0e391d /src/api/endpoints/i
parent[API] Fix bug and extract validator (diff)
downloadsharkey-93c3faf141c1927a390b2e22169cad90a6a628ed.tar.gz
sharkey-93c3faf141c1927a390b2e22169cad90a6a628ed.tar.bz2
sharkey-93c3faf141c1927a390b2e22169cad90a6a628ed.zip
[API] Fix bug and change limit 50 to 30
Diffstat (limited to 'src/api/endpoints/i')
-rw-r--r--src/api/endpoints/i/update.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/api/endpoints/i/update.js b/src/api/endpoints/i/update.js
index 4b4d1743da..4abb4fcb7b 100644
--- a/src/api/endpoints/i/update.js
+++ b/src/api/endpoints/i/update.js
@@ -25,6 +25,10 @@ module.exports = async (params, user, _, isSecure) =>
// Get 'name' parameter
const name = params.name;
if (name !== undefined && name !== null) {
+ if (typeof name != 'string') {
+ return rej('name must be a string');
+ }
+
if (!isValidName(name)) {
return rej('invalid name');
}