From e08ad71b7e4122c075c321a3a5889ba3ab454442 Mon Sep 17 00:00:00 2001 From: Dixie J Date: Tue, 8 Mar 2022 17:00:12 +0800 Subject: [PATCH] PATCH v3.1.7 (Added another JSON Reader Exception falloff) --- ValorantCC/ValorantCC.csproj | 2 +- ValorantCC/src/Auth.cs | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ValorantCC/ValorantCC.csproj b/ValorantCC/ValorantCC.csproj index 747bf8b..0f3c9ba 100644 --- a/ValorantCC/ValorantCC.csproj +++ b/ValorantCC/ValorantCC.csproj @@ -14,7 +14,7 @@ false - 3.1.6 + 3.1.7 true diff --git a/ValorantCC/src/Auth.cs b/ValorantCC/src/Auth.cs index afc224a..7097a09 100644 --- a/ValorantCC/src/Auth.cs +++ b/ValorantCC/src/Auth.cs @@ -114,13 +114,20 @@ private async Task ObtainAuthTokens() private async static Task GetVersion() { + string ver = "release-04.04-shipping-15-678808"; Utilities.Utils.Log("Obtaining Client Version info"); RestRequest request = new RestRequest("https://vtools-next.vercel.app/api/skinslist/version", Method.Get); RestResponse response = await client.ExecuteAsync(request); - if (!response.IsSuccessful) return "release-04.04-shipping-15-678808"; - - VersionResponse RespData = JsonConvert.DeserializeObject(response.Content.ToString()); + if (!response.IsSuccessful) return ver; + VersionResponse RespData; + try + { + RespData = JsonConvert.DeserializeObject(response.Content.ToString()); + } catch (JsonReaderException) + { + return ver; + } RespData.Status = ((int)response.StatusCode); return RespData.riotClientVersion; }