diff --git a/FunctionAnalyser/CommandFilesApi/Updater.cs b/FunctionAnalyser/CommandFilesApi/Updater.cs index e01c719..47fe330 100644 --- a/FunctionAnalyser/CommandFilesApi/Updater.cs +++ b/FunctionAnalyser/CommandFilesApi/Updater.cs @@ -25,6 +25,7 @@ public Updater(ILogger logger) Client.DefaultRequestHeaders.Accept.Clear(); Client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); Client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("text/plain")); + Client.DefaultRequestHeaders.UserAgent.TryParseAdd("request"); } public async Task CheckForUpdate() @@ -60,6 +61,7 @@ private async Task GetChangelog(GitHubVersion update) try { GitHubAssets changelogAssets = update.GetAssets().FirstOrDefault(a => a.GetLabel() == CHANGELOG_LABEL); + if (changelogAssets == null) return ""; using HttpResponseMessage response = await Client.GetAsync(changelogAssets.GetDownloadUrl()); if (response.IsSuccessStatusCode) { @@ -68,7 +70,7 @@ private async Task GetChangelog(GitHubVersion update) } catch (HttpRequestException) { } - return null; + return ""; } private static GitHubAssets GetFileAssets(GitHubVersion update)