From c7dc14d4f99943cfed1dd79d833784c2eedb3762 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Thu, 16 Jul 2015 12:56:19 -0800 Subject: [PATCH] catch split exception in parsebase64 --- app/utils/parse-base64.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/utils/parse-base64.js b/app/utils/parse-base64.js index deb8f8c..5735e8f 100644 --- a/app/utils/parse-base64.js +++ b/app/utils/parse-base64.js @@ -1,6 +1,7 @@ export default function parseBase64(token) { - let tokenData = atob(token.split('.')[1]); + let tokenData; try { + tokenData = atob(token.split('.')[1]); return JSON.parse(tokenData); } catch (e) { return tokenData;