From 7f853df5817d468cee03334149ba448909b5f56f Mon Sep 17 00:00:00 2001 From: Alex P Date: Wed, 14 Jun 2017 17:08:57 -0700 Subject: [PATCH] Jared wrote this --- ui/src/status/actions/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ui/src/status/actions/index.js b/ui/src/status/actions/index.js index 9d5d06201..c168090a7 100644 --- a/ui/src/status/actions/index.js +++ b/ui/src/status/actions/index.js @@ -23,7 +23,12 @@ export const fetchJSONFeedAsync = url => async dispatch => { dispatch(fetchJSONFeedRequested()) try { const {data} = await fetchJSONFeedAJAX(url) - dispatch(fetchJSONFeedCompleted(data)) + // data could be from a webpage, and thus would be HTML + if (typeof data === 'string' || !data) { + dispatch(fetchJSONFeedFailed()) + } else { + dispatch(fetchJSONFeedCompleted(data)) + } } catch (error) { console.error(error) dispatch(fetchJSONFeedFailed())