From a8e215c74ec8e3152a3aaf34b31ecb5c417222a4 Mon Sep 17 00:00:00 2001 From: terakilobyte Date: Mon, 27 Apr 2015 20:03:37 -0400 Subject: [PATCH] Check everything for undefined in email reply logic for story.js --- controllers/story.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/story.js b/controllers/story.js index 1f1bf90247..0e7af182f6 100755 --- a/controllers/story.js +++ b/controllers/story.js @@ -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: {