From b1f41add0ed176f19e29e099cfc49207b10305f6 Mon Sep 17 00:00:00 2001 From: FloatingGhost Date: Mon, 21 Nov 2022 17:08:53 +0000 Subject: [PATCH] Don't error out if we can't fetch reports --- src/services/api/api.service.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js index 4e3e1ced..aeb43661 100644 --- a/src/services/api/api.service.js +++ b/src/services/api/api.service.js @@ -650,7 +650,7 @@ const getReports = ({ state, limit, page, pageSize, credentials }) => { url = url + (args ? '?' + args : '') return fetch(url, { headers: authHeaders(credentials) }) .then((data) => data.json()) - .then((data) => data.reports.map(parseReport)) + .then((data) => data?.reports?.map(parseReport) ?? []) } const updateReportStates = ({ credentials, reports }) => {