Skip to content

Commit

Permalink
(chocolateyGH-1397) Handle null result.
Browse files Browse the repository at this point in the history
  • Loading branch information
DamianMaslanka5 committed Feb 20, 2018
1 parent ebc2ab7 commit cad9943
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/chocolatey/infrastructure.app/services/NugetService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -864,6 +864,12 @@ public ConcurrentDictionary<string, PackageResult> get_outdated(ChocolateyConfig
{
var latestPackage = packageManager.SourceRepository.GetPackages().Where(x => x.Id.ToLower() == packageName && x.IsLatestVersion).FirstOrDefault();

if(latestPackage == null)
{
this.Log().Warn(packageName + " doesn't exists in the current source.");
continue;
}

var installedPackage = packageManager.LocalRepository.FindPackage(packageName);

if (latestPackage.Version > installedPackage.Version)
Expand Down

0 comments on commit cad9943

Please sign in to comment.