Skip to content
This repository was archived by the owner on Aug 11, 2021. It is now read-only.

Commit c3c34a6

Browse files
committed
Fixes #525. Resolving a package, when there is both an unversioned and (many) versioned candidates no longer fails with a null dereference. I believe this is a rare situation - usually all candidates for a package will be versioned when there is more than one.
1 parent 28e6f69 commit c3c34a6

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Bam.Core/Package/PackageDefinition.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1099,7 +1099,8 @@ public static void
10991099
var candidates = candidatePackageDefinitions.Where(item => item.Name.Equals(depName, System.StringComparison.Ordinal));
11001100
if (depVersion != null)
11011101
{
1102-
candidates = candidates.Where(item => item.Version.Equals(depVersion, System.StringComparison.Ordinal));
1102+
// the item.Version check is in case the candidates list has both versioned and an unversioned package
1103+
candidates = candidates.Where(item => item.Version != null && item.Version.Equals(depVersion, System.StringComparison.Ordinal));
11031104
}
11041105
var candidateCount = candidates.Count();
11051106
if (0 == candidateCount)

Changelog.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
09-Mar-2019 Fixes #525. Resolving a package, when there is both an unversioned and (many) versioned candidates no longer fails with a null dereference. I believe this is a rare situation - usually all candidates for a package will be versioned when there is more than one.
2+
13
09-Mar-2019 Fixes #524. Upgraded NuGet dependencies:
24
GitInfo from 2.0.15 to 2.0.20
35
Microsoft.NET.Test.Sdk from 15.8.0 to 16.0.1

0 commit comments

Comments
 (0)