0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00: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
parent f351357159
commit 84ae8585c6

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;