diff --git a/app/soapbox/actions/alerts.ts b/app/soapbox/actions/alerts.ts index 2fc253158..bbb492e42 100644 --- a/app/soapbox/actions/alerts.ts +++ b/app/soapbox/actions/alerts.ts @@ -38,7 +38,7 @@ function showAlert( } const showAlertForError = (error: AxiosError) => (dispatch: React.Dispatch, _getState: any) => { - if (error.response) { + if (error?.response) { const { data, status, statusText } = error.response; if (status === 502) { @@ -52,7 +52,7 @@ const showAlertForError = (error: AxiosError) => (dispatch: React.Dispatch< let message: string | undefined = statusText; - if (data.error) { + if (data?.error) { message = data.error; }