0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00

Updated error name check in GhostMailer

no issue
refs e8511d0568

- Adds extra check for empty `err` object while checking error name for status code in GhostMailer
This commit is contained in:
Rish 2020-07-21 01:08:19 +05:30
parent e8511d0568
commit 3d164d222b

View file

@ -48,7 +48,7 @@ function createMessage(message) {
function createMailError({message, err, ignoreDefaultMessage} = {message: ''}) {
const fullErrorMessage = defaultErrorMessage + message;
let statusCode = err.name === 'RecipientError' ? 400 : 500;
let statusCode = (err && err.name === 'RecipientError') ? 400 : 500;
return new errors.EmailError({
message: ignoreDefaultMessage ? message : fullErrorMessage,
err: err,