Skip to content
Snippets Groups Projects
Unverified Commit 2bbbc956 authored by Michael Kriese's avatar Michael Kriese Committed by GitHub
Browse files

fix(manager/nuget): Skip dep if version is undefined (#16757)

parent 5f83529e
No related merge requests found
......@@ -34,6 +34,7 @@
<PackageReference Include="NotUpdatable3" Version="(1.2.3, 3.2.1)" />
<PackageReference Include="NotUpdatable3" Version="[1.2.3, 3.2.1]" />
<PackageReference Include="NotUpdatable3" Version="[1.2.3, 3.2.1)" />
<PackageReference Include="NotUpdatable3" />
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="1.0.0" />
......
import is from '@sindresorhus/is';
import { XmlDocument, XmlElement, XmlNode } from 'xmldoc';
import { logger } from '../../../logger';
import { getSiblingFileName, localPathExists } from '../../../util/fs';
......@@ -48,10 +49,9 @@ function extractDepsFromXml(xmlNode: XmlDocument): PackageDependency[] {
child.valueWithPath('Version') ??
attr?.VersionOverride ??
child.valueWithPath('VersionOverride');
const currentValue = checkVersion
?.exec(version)
?.groups?.currentValue?.trim();
const currentValue = is.nonEmptyStringAndNotWhitespace(version)
? checkVersion.exec(version)?.groups?.currentValue?.trim()
: undefined;
if (depName && currentValue) {
results.push({
datasource: NugetDatasource.id,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment