Skip to content

Node.js based forum software built for the modern web

if no email dont send

Baris Usakliba9397987a6a
diff --git a/src/user/email.js b/src/user/email.js
index 9dafee3fa7..734e247eb1 100644
--- a/src/user/email.js
+++ b/src/user/email.js
@@ -56,19 +56,17 @@ UserEmail.sendValidationEmail = function (uid, options, callback) {
function (next) {
// If no email passed in (default), retrieve email from uid
if (options.email && options.email.length) {
- return setImmediate(next);
+ return setImmediate(next, null, options.email);
}
- user.getUserField(uid, 'email', function (err, email) {
- if (err) {
- return next(err);
- }
-
- options.email = email;
- next();
- });
+ user.getUserField(uid, 'email', next);
},
- function (next) {
+ function (email, next) {
+ options.email = email;
+ if (!options.email) {
+ return callback();
+ }
+
if (options.force) {
return setImmediate(next, null, false);
}