From 8103e91c93d7c8530500aaf5203b4d9834f20089 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Mon, 4 Feb 2019 17:19:03 +0300 Subject: [PATCH] Resolved #778 --- .../Docs/GitHub/Documents/GithubDocumentStore.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/GitHub/Documents/GithubDocumentStore.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/GitHub/Documents/GithubDocumentStore.cs index 623cf40f4f..5f92d565c2 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/GitHub/Documents/GithubDocumentStore.cs +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/GitHub/Documents/GithubDocumentStore.cs @@ -56,9 +56,10 @@ namespace Volo.Docs.GitHub.Documents public async Task> GetVersions(Project project) { + List versions; try { - return (await GetReleasesAsync(project)) + versions = (await GetReleasesAsync(project)) .OrderByDescending(r => r.PublishedAt) .Select(r => new VersionInfo { @@ -70,8 +71,15 @@ namespace Volo.Docs.GitHub.Documents { //TODO: It may not be a good idea to hide the error! Logger.LogError(ex.Message, ex); - return new List(); + versions = new List(); } + + if (!versions.Any() && !string.IsNullOrEmpty(project.LatestVersionBranchName)) + { + versions.Add(new VersionInfo { DisplayName = "1.0.0", Name = project.LatestVersionBranchName }); + } + + return versions; } public async Task GetResource(Project project, string resourceName, string version)