gracefully handle original story poster having been deleted in mailer
This commit is contained in:
@ -517,6 +517,7 @@ exports.storySubmission = function(req, res, next) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
if (recipient && recipient.email) {
|
||||
// If the emails of both authors differ, only then proceed with email notification
|
||||
if (data.author.email && (data.author.email !== recipient.email)) {
|
||||
var transporter = nodemailer.createTransport({
|
||||
@ -545,6 +546,7 @@ exports.storySubmission = function(req, res, next) {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
} catch (e) {
|
||||
|
Reference in New Issue
Block a user