Skip to content

Commit

Permalink
fix: Skip empty version property
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromelaban committed Jun 28, 2024
1 parent 1904d5d commit 669fe85
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/NvGet/Extensions/XmlDocumentExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,12 @@ public static PackageIdentity[] GetPackageReferences(this XmlDocument document)

var packageName = string.Concat(nameParts).ToLowerInvariant();

if(NuGetVersion.TryParse(versionProperty.InnerText, out var nugetVersion))
if(!string.IsNullOrWhiteSpace(packageName))
{
references.Add(CreatePackageIdentity(packageName, versionProperty.InnerText));
if(NuGetVersion.TryParse(versionProperty.InnerText, out var nugetVersion))
{
references.Add(CreatePackageIdentity(packageName, versionProperty.InnerText));
}
}
}

Expand Down

0 comments on commit 669fe85

Please sign in to comment.