Skip to content

Commit

Permalink
Removed null check in version parsing
Browse files Browse the repository at this point in the history
Signature of System.Version.Parse is wrong!
  • Loading branch information
paoloambrosio committed Jan 1, 2025
1 parent 79fb2d3 commit 0036043
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Core/SoftwareUpdates/GitHubUpdateChecker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ public async Task<bool> CheckUpdateAvailable()
var client = new GitHubClient(new ProductHeaderValue(config.GitHubClientApp));
var release = await client.Repository.Release.GetLatest(config.GitHubOwner, config.GitHubRepo);

// Note: Version.Parse breaks the contract and can return null!
var latestVersion = Version.Parse(release.Name);
var currentVersion = Version.Parse(GitVersionInformation.MajorMinorPatch);
return latestVersion is not null && currentVersion < latestVersion;
return currentVersion < latestVersion;
}
catch
{
Expand Down

0 comments on commit 0036043

Please sign in to comment.