Check everything for undefined in email reply logic for story.js

pull/390/head
terakilobyte 2015-04-27 20:03:37 -04:00
parent 11c887c55f
commit a8e215c74e
1 changed files with 1 additions and 1 deletions

View File

@ -518,7 +518,7 @@ exports.storySubmission = function(req, res, next) {
return next(err);
}
// If the emails of both authors differ, only then proceed with email notification
if (data.author.email && (data.author.email !== recipient.email)) {
if (typeof data.author !== 'undefined' && data.author.email && typeof recipient !== 'undefined' && recipient.email && (data.author.email !== recipient.email)) {
var transporter = nodemailer.createTransport({
service: 'Mandrill',
auth: {