diff --git a/Utility/Updater.cs b/Utility/Updater.cs index cd552d8..872517a 100644 --- a/Utility/Updater.cs +++ b/Utility/Updater.cs @@ -54,14 +54,22 @@ public static string ServerClientVersion { get { - client.DefaultRequestHeaders.Accept.Clear(); - client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/vnd.github.v3+json")); - client.DefaultRequestHeaders.Add("User-Agent", "Genie Client Updater"); + try + { + client.DefaultRequestHeaders.Accept.Clear(); + client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/vnd.github.v3+json")); + client.DefaultRequestHeaders.Add("User-Agent", "Genie Client Updater"); - var streamTask = client.GetStreamAsync(GitHubClientReleaseURL).Result; - Release latest = JsonSerializer.Deserialize(streamTask); + var streamTask = client.GetStreamAsync(GitHubClientReleaseURL).Result; + Release latest = JsonSerializer.Deserialize(streamTask); - return latest.Version; + return latest.Version; + } + catch + { + //if we can't reach github just report current because we can't update + return LocalClientVersion; + } } }