bugfix call that is made with null

This commit is contained in:
wodka 2019-10-10 15:20:14 +02:00
parent 9e34fa9c50
commit 2e5184c0db

View File

@ -110,7 +110,7 @@ UserSchema.virtual('password').get(function () {
* Create instance method for hashing a password
*/
UserSchema.statics.hashPassword = UserSchema.methods.hashPassword = function(password) {
return bcrypt.hashSync(password, 4);
return password ? bcrypt.hashSync(password, 4) : false;
};
/**