Skip to content

Commit

Permalink
fix NRE in RequiredDependencyPackageCurator
Browse files Browse the repository at this point in the history
  • Loading branch information
derigel23 committed Jun 30, 2016
1 parent 02b35c0 commit 1758184
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public override void Curate(Package galleryPackage, INupkg nugetPackage, bool co

var feedDependencies = (from d in galleryPackage.Dependencies
from cf in curatedFeeds
where d.Id.Equals(cf.Id, StringComparison.OrdinalIgnoreCase)
where string.Equals(d.Id, cf.Id, StringComparison.OrdinalIgnoreCase)
&& (CuratedFeedWantsAllVersions(cf.Version) || CuratedFeedSatisfiesDependency(cf.Version, d))
select new {Dependency = d, cf.Feed, FeedId = cf.Id}).ToList();

Expand Down Expand Up @@ -87,11 +87,14 @@ private IEnumerable<Package> GetMatchingPackages(string packageRegistrationId, s
var packageRegistrationRepository = GetService<IEntityRepository<PackageRegistration>>();
var candidatePackages = packageRegistrationRepository.GetAll()
.Include(pr => pr.Packages)
.Where(pr => pr.Id == packageRegistrationId)
.Where(pr => pr.Id.Equals(packageRegistrationId, StringComparison.OrdinalIgnoreCase))
.SelectMany(pr => pr.Packages)
.Include(p => p.PackageRegistration)
.ToList();

if (requiredVersionSpec == null)
return candidatePackages;

var versionSpec = VersionUtility.ParseVersionSpec(requiredVersionSpec);
var dependencies = from p in candidatePackages
where versionSpec.Satisfies(new SemanticVersion(p.Version))
Expand Down

0 comments on commit 1758184

Please sign in to comment.