Don't die when updating plugins with no releases

This commit is contained in:
Brant Martin
2019-03-03 19:02:20 -05:00
parent 3d3769cf5a
commit 5eb6e9990c

View File

@@ -153,6 +153,13 @@ namespace Torch.Managers
manifest.Version.TryExtractVersion(out Version currentVersion); manifest.Version.TryExtractVersion(out Version currentVersion);
var latest = await PluginQuery.Instance.QueryOne(manifest.Guid); var latest = await PluginQuery.Instance.QueryOne(manifest.Guid);
if (latest?.LatestVersion == null)
{
_log.Warn($"Plugin {manifest.Name} does not have any releases on torchapi.net. Cannot update.");
return;
}
latest.LatestVersion.TryExtractVersion(out Version newVersion); latest.LatestVersion.TryExtractVersion(out Version newVersion);
if (currentVersion == null || newVersion == null) if (currentVersion == null || newVersion == null)