mirror of
https://github.com/strapi/strapi.git
synced 2025-11-03 03:17:11 +00:00
Update User.js
This commit is contained in:
parent
5d82812355
commit
11c68bebf2
@ -130,7 +130,7 @@ module.exports = {
|
||||
email: ctx.request.body.email
|
||||
});
|
||||
|
||||
if ((user.id || user._id).toString() !== ctx.params.id) {
|
||||
if (user !== null && (user.id || user._id).toString() !== ctx.params.id) {
|
||||
return ctx.badRequest(null, ctx.request.admin ? [{ messages: [{ id: 'Auth.form.error.email.taken' }] }] : 'Email is already taken.');
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user