mirror of
https://gitlab.com/ryzen-controller-team/ryzen-controller.git
synced 2024-12-22 18:13:28 +07:00
fix: Avoid error when gitlab release api won't return a good response.
This commit is contained in:
parent
7c5485b37b
commit
10954f3fec
@ -558,7 +558,13 @@ function checkForNewRelease() {
|
|||||||
|
|
||||||
request.onload = function() {
|
request.onload = function() {
|
||||||
if (this.status >= 200 && this.status < 400) {
|
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) {
|
if (resp[0].tag_name !== version) {
|
||||||
notification('primary', "A new vesion is available, please check the release tab.");
|
notification('primary', "A new vesion is available, please check the release tab.");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user