From 015269914e0908799a4a958fe8af39cb81984986 Mon Sep 17 00:00:00 2001 From: Sorin Davidoi Date: Wed, 19 Jul 2017 19:38:50 +0200 Subject: [PATCH] fix: Handle errors without response (#4274) --- app/javascript/mastodon/actions/statuses.js | 2 +- app/javascript/mastodon/actions/timelines.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/javascript/mastodon/actions/statuses.js b/app/javascript/mastodon/actions/statuses.js index 8d385715c3..2204e0b14a 100644 --- a/app/javascript/mastodon/actions/statuses.js +++ b/app/javascript/mastodon/actions/statuses.js @@ -113,7 +113,7 @@ export function fetchContext(id) { dispatch(fetchContextSuccess(id, response.data.ancestors, response.data.descendants)); }).catch(error => { - if (error.response.status === 404) { + if (error.response && error.response.status === 404) { dispatch(deleteFromTimelines(id)); } diff --git a/app/javascript/mastodon/actions/timelines.js b/app/javascript/mastodon/actions/timelines.js index dd14cb1cd0..5c0cd93c7e 100644 --- a/app/javascript/mastodon/actions/timelines.js +++ b/app/javascript/mastodon/actions/timelines.js @@ -105,7 +105,7 @@ export function refreshTimelineFail(timeline, error, skipLoading) { timeline, error, skipLoading, - skipAlert: error.response.status === 404, + skipAlert: error.response && error.response.status === 404, }; };