actions/alerts: access properties more carefully

merge-requests/1548/head
Alex Gleason 2022-06-20 11:52:36 -05:00
rodzic 6530fcf37b
commit 01b46e249b
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -38,7 +38,7 @@ function showAlert(
}
const showAlertForError = (error: AxiosError<any>) => (dispatch: React.Dispatch<AnyAction>, _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<any>) => (dispatch: React.Dispatch<
let message: string | undefined = statusText;
if (data.error) {
if (data?.error) {
message = data.error;
}