diff --git a/src/NvGet/Extensions/XmlDocumentExtensions.cs b/src/NvGet/Extensions/XmlDocumentExtensions.cs index d122b02..fd0f6f9 100644 --- a/src/NvGet/Extensions/XmlDocumentExtensions.cs +++ b/src/NvGet/Extensions/XmlDocumentExtensions.cs @@ -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)); + } } }