From e85563c96e5b6f986c504c354bd58f77301ed0f2 Mon Sep 17 00:00:00 2001 From: Matthew Taylor Date: Wed, 20 Jan 2016 08:36:05 -0500 Subject: [PATCH] surround redirect check in try/catch based on the suggestion by @rschamp! --- src/mixins/api.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mixins/api.jsx b/src/mixins/api.jsx index d9c2ddbd9..f0f0269f2 100644 --- a/src/mixins/api.jsx +++ b/src/mixins/api.jsx @@ -44,7 +44,11 @@ var Api = { if (err) log.error(err); // Legacy API responses come as lists, and indicate to redirect the client like // [{success: true, redirect: "/location/to/redirect"}] - if (body && body[0] && 'redirect' in body[0]) window.location = body[0].redirect; + try { + if (body && body[0] && 'redirect' in body[0]) window.location = body[0].redirect; + } catch (err) { + // do nothing + } callback(err, body); }); }.bind(this);