UpdateManager: check there is a future release before comparing release versions

This commit is contained in:
Nick Vella 2019-08-08 00:16:19 +10:00
parent c1591d8873
commit 654465e576
1 changed files with 3 additions and 1 deletions

View File

@ -44,7 +44,9 @@ namespace OpenLiveWriter.PostEditor.Updates
{
var update = await manager.CheckForUpdate();
if(update.FutureReleaseEntry.Version < update.CurrentlyInstalledVersion.Version)
if(update != null &&
update.ReleasesToApply.Count > 0 &&
update.FutureReleaseEntry.Version < update.CurrentlyInstalledVersion.Version)
{
Trace.WriteLine("Update is older than currently running version, not installing.");
Trace.WriteLine($"Current: {update.CurrentlyInstalledVersion.Version} Update: {update.FutureReleaseEntry.Version}");