Fix First call.

This commit is contained in:
Gandifil 2023-12-21 19:40:08 +03:00
parent a8ed920103
commit 0c42ff4409

View file

@ -214,7 +214,9 @@ public static class Program {
foreach (var property in projectRootElement.AllChildren.Where(x => x.ElementName == "PackageReference").Select(x => x as ProjectItemElement))
{
var libraryName = property.Include;
var version = (property.Children.First() as ProjectMetadataElement).Value;
if (property.Children.FirstOrDefault(x => x.ElementName == "Version") is not ProjectMetadataElement versionElement)
continue;
var version = versionElement.Value;
if (referencesVersions.Keys.Contains(libraryName))
{
referencesVersions[libraryName] = version;