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

Added guard for page.items existing in Mailgun response

no issue

- it's possible to get Mailgun responses where the `items` array doesn't exist so we need to guard against that so we don't error
This commit is contained in:
Kevin Ansfield 2020-12-07 11:06:53 +00:00 committed by Daniel Lockyer
parent 0f6f5d09db
commit 2fe94f34ff
No known key found for this signature in database
GPG key ID: FFBC6FA2A6F6ABC1

View file

@ -107,7 +107,7 @@ class EmailAnalyticsMailgunProvider {
}
page = await mailgun.get(page.paging.next.replace('https://api.mailgun.net/v3', ''));
events = page.items.map(this.normalizeEvent);
events = page && page.items && page.items.map(this.normalizeEvent) || [];
}
return result;