mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-12 14:51:02 +01:00
[API] Fix bug
This commit is contained in:
parent
e407cca90b
commit
4f1a65f758
1 changed files with 4 additions and 0 deletions
|
@ -31,6 +31,10 @@ module.exports = (params, user) =>
|
|||
// Get 'user_id' parameter
|
||||
let recipient = params.user_id;
|
||||
if (recipient !== undefined && recipient !== null) {
|
||||
if (typeof recipient != 'string') {
|
||||
return rej('user_id must be a string');
|
||||
}
|
||||
|
||||
// Validate id
|
||||
if (!mongo.ObjectID.isValid(recipient)) {
|
||||
return rej('incorrect user_id');
|
||||
|
|
Loading…
Reference in a new issue