fix: Avoid error when gitlab release api won't return a good response.

This commit is contained in:
Quentin DECAUNES 2019-08-06 17:26:31 +02:00
parent 7c5485b37b
commit 10954f3fec

View File

@ -558,7 +558,13 @@ function checkForNewRelease() {
request.onload = function() {
if (this.status >= 200 && this.status < 400) {
var resp = JSON.parse(this.response);
var resp = {};
try {
resp = JSON.parse(this.response);
} catch (error) {
console.log('WARNING: unable to check if a new version is available.', error);
return;
}
if (resp[0].tag_name !== version) {
notification('primary', "A new vesion is available, please check the release tab.");
}