diff --git a/packages/rocketchat-user-data-download/server/cronProcessDownloads.js b/packages/rocketchat-user-data-download/server/cronProcessDownloads.js index 59af82a29b82..c275d807f1ae 100644 --- a/packages/rocketchat-user-data-download/server/cronProcessDownloads.js +++ b/packages/rocketchat-user-data-download/server/cronProcessDownloads.js @@ -291,7 +291,7 @@ const sendEmail = function(userId) { } const userData = RocketChat.models.Users.findOneById(userId); - if (!userData || userData.emails || userData.emails[0] || userData.emails[0].address) { + if (!userData || !userData.emails || !userData.emails[0] || !userData.emails[0].address) { return; } const emailAddress = `${ userData.name } <${ userData.emails[0].address }>`;