From 4388b2acb102884b73b12f0eedad915d73109d34 Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Thu, 26 Sep 2019 13:53:04 -0300 Subject: [PATCH] [FIX] Try/catch JSON.parse XHR response (#1238) --- app/lib/methods/sendFileMessage.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/lib/methods/sendFileMessage.js b/app/lib/methods/sendFileMessage.js index 2b5bdf45..dc867411 100644 --- a/app/lib/methods/sendFileMessage.js +++ b/app/lib/methods/sendFileMessage.js @@ -112,8 +112,12 @@ export function sendFileMessage(rid, fileInfo, tmid, server, user) { } catch (e) { log(e); } - const response = JSON.parse(xhr.response); - reject(response); + try { + const response = JSON.parse(xhr.response); + reject(response); + } catch (e) { + reject(e); + } } };