mirror of
https://github.com/ppy/osu
synced 2025-01-12 09:09:44 +00:00
Fix update code crashing when no internet connection is available
This commit is contained in:
parent
bebbbaa73c
commit
67a759122a
@ -40,8 +40,11 @@ namespace osu.Desktop.Updater
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async void checkForUpdateAsync()
|
private async void checkForUpdateAsync()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
var releases = new JsonWebRequest<GitHubRelease>("https://api.github.com/repos/ppy/osu/releases/latest");
|
var releases = new JsonWebRequest<GitHubRelease>("https://api.github.com/repos/ppy/osu/releases/latest");
|
||||||
|
|
||||||
await releases.PerformAsync();
|
await releases.PerformAsync();
|
||||||
|
|
||||||
var latest = releases.ResponseObject;
|
var latest = releases.ResponseObject;
|
||||||
@ -61,6 +64,11 @@ namespace osu.Desktop.Updater
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
// we shouldn't crash on a web failure. or any failure for the matter.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private string getBestUrl(GitHubRelease release)
|
private string getBestUrl(GitHubRelease release)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user