Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Skip empty version property #17

Merged
merged 1 commit into from
Jun 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@

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 Expand Up @@ -185,7 +188,7 @@
/// <param name="path"></param>
/// <param name="ct"></param>
/// <returns></returns>
public static async Task<XmlDocument> LoadDocument(this string path, CancellationToken ct)

Check warning on line 191 in src/NvGet/Extensions/XmlDocumentExtensions.cs

View workflow job for this annotation

GitHub Actions / Build Tools

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
{
#if WINDOWS_UWP
var file = await StorageFile
Expand Down
Loading