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

fix(manager/nuget): skip invalid xml files (#16758)

parent 2bbbc956
Branches
Tags
No related merge requests found
......@@ -155,12 +155,10 @@ describe('modules/manager/nuget/package-tree', () => {
);
});
it('throws error on invalid xml file', async () => {
it('skips on invalid xml file', async () => {
git.getFileList.mockResolvedValue(['foo/bar.csproj']);
Fixtures.mock({ '/tmp/repo/foo/bar.csproj': '<invalid' });
await expect(getDependentPackageFiles('foo/bar.csproj')).rejects.toThrow(
'Invalid xml file: foo/bar.csproj'
);
expect(await getDependentPackageFiles('foo/bar.csproj')).toEqual([]);
});
});
});
......@@ -40,7 +40,7 @@ export async function getDependentPackageFiles(
for (const f of packageFiles) {
const doc = await readFileAsXmlDocument(f);
if (!doc) {
throw new Error(`Invalid xml file: ${f}`);
continue;
}
const projectReferenceAttributes = doc
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment