[FIX] Try/catch JSON.parse XHR response (#1238)

This commit is contained in:
Diego Mello 2019-09-26 13:53:04 -03:00 committed by GitHub
parent 1c22cc2f9f
commit 4388b2acb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -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);
}
}
};