diff --git a/src/api/axios.ts b/src/api/axios.ts index b89c47fa..c97fcc79 100644 --- a/src/api/axios.ts +++ b/src/api/axios.ts @@ -86,7 +86,9 @@ export const fallbackToPublic = ( return request() .then(({ data }) => fallbackForArray(data, publicRequest)) .catch((error) => { - if (FALLBACK_TO_PUBLIC_FOR_STATUS_CODES.includes(error.response.status)) { + if ( + FALLBACK_TO_PUBLIC_FOR_STATUS_CODES.includes(error.response?.status) + ) { return publicRequest() .then(({ data }) => data) .catch((e) => returnFallbackDataOrThrow(e, options?.fallbackData));