about summary refs log tree commit diff
path: root/app/assets/javascripts
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-12-11 23:18:41 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-12-11 23:18:41 +0100
commitf92cb02b9bc4b6b09c48dee72ac3a9f0de213dc3 (patch)
treed72526639d13ed3a22563f9d53805159d35092c0 /app/assets/javascripts
parent2b22c3303923928bb10ab64130bbf924e2f0de65 (diff)
Fix #203 - try/catch around JSON parse
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r--app/assets/javascripts/components/api.jsx6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/assets/javascripts/components/api.jsx b/app/assets/javascripts/components/api.jsx
index 080c2bd6a..93cfc8046 100644
--- a/app/assets/javascripts/components/api.jsx
+++ b/app/assets/javascripts/components/api.jsx
@@ -17,6 +17,10 @@ export default getState => axios.create({
   },
 
   transformResponse: [function (data) {
-    return JSON.parse(data);
+    try {
+      return JSON.parse(data);
+    } catch(Exception) {
+      return data;
+    }
   }]
 });