Skip to content

Commit

Permalink
Fixed NuGet Solution UI selected package version should be keep when …
Browse files Browse the repository at this point in the history
…it's still valid

NuGet/Home#3371
  • Loading branch information
zhili1208 committed Aug 30, 2016
1 parent 32668b8 commit 056274f
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -268,16 +268,16 @@ public DisplayVersion SelectedVersion
// Calculate the version to select among _versions and select it
protected void SelectVersion()
{
DisplayVersion versionToSelect = null;

if (_versions.Count > 0)
if (_versions.Count == 0)
{
SelectedVersion = null;
}
else if (!_versions.Contains(SelectedVersion))
{
// it should always select the top version from versions list to install or update
// which has a valid version. If find none, then just set to null.
versionToSelect = _versions.FirstOrDefault(v => v != null && v.IsValidVersion);
SelectedVersion = _versions.FirstOrDefault(v => v != null && v.IsValidVersion);
}

SelectedVersion = versionToSelect;
}

internal async Task LoadPackageMetadaAsync(IPackageMetadataProvider metadataProvider, CancellationToken token)
Expand Down

0 comments on commit 056274f

Please sign in to comment.