From 3ef12efc9a7c686cc93b2fef882c7fdd849dff57 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Wed, 16 Jun 2021 02:00:04 +0200 Subject: [PATCH] Check if mod repo exists --- TBMM/MainModList.cs | 12 +++++++++++- TBMM/TBMM.csproj | 1 - 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/TBMM/MainModList.cs b/TBMM/MainModList.cs index 0cdce74..744e7c0 100644 --- a/TBMM/MainModList.cs +++ b/TBMM/MainModList.cs @@ -102,7 +102,17 @@ namespace TBMM string repoURL = "/api/v1/repos/" + mod.Author + "/" + mod.Name + "/releases"; using (var client = GetClient()) { - var arr = JArray.Parse(await client.DownloadStringTaskAsync(repoURL)); + string str; + try + { + str = await client.DownloadStringTaskAsync(repoURL); + } + catch (WebException) + { + return false; + } + + var arr = JArray.Parse(str); var release = arr.FirstOrDefault(rel => { if ((bool) rel["prerelease"] || (bool) rel["draft"]) diff --git a/TBMM/TBMM.csproj b/TBMM/TBMM.csproj index 3688a93..deb8382 100644 --- a/TBMM/TBMM.csproj +++ b/TBMM/TBMM.csproj @@ -12,7 +12,6 @@ A mod manager for Techblox. It automatically downloads and runs GCIPA and allows the user to install mods. true 8 - GCMM