]> cat aescling's git repositories - mastodon.git/commitdiff
fix: Handle errors without response (#4274)
authorSorin Davidoi <sorin.davidoi@gmail.com>
Wed, 19 Jul 2017 17:38:50 +0000 (19:38 +0200)
committerEugen Rochko <eugen@zeonfederated.com>
Wed, 19 Jul 2017 17:38:50 +0000 (19:38 +0200)
app/javascript/mastodon/actions/statuses.js
app/javascript/mastodon/actions/timelines.js

index 8d385715c310ea72d559d13e0a2313e6e5d2daa9..2204e0b14a671925bb99be1904dd8831e9905f5e 100644 (file)
@@ -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));
       }
 
index dd14cb1cd03b92737563115ce3af7eb7920ccc12..5c0cd93c7e66a3df774e0592daf34a4515313c5e 100644 (file)
@@ -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,
   };
 };