Check if mod repo exists

This commit is contained in:
Norbi Peti 2021-06-16 02:00:04 +02:00
parent c0bbd97953
commit 3ef12efc9a
2 changed files with 11 additions and 2 deletions

View file

@ -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"])

View file

@ -12,7 +12,6 @@
<Description>A mod manager for Techblox. It automatically downloads and runs GCIPA and allows the user to install mods.</Description>
<GenerateResourceUsePreserializedResources>true</GenerateResourceUsePreserializedResources>
<LangVersion>8</LangVersion>
<RootNamespace>GCMM</RootNamespace>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">