mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-12 23:16:26 +00:00
fix(gradle): Avoid crash for missing managerData (#11727)
This commit is contained in:
parent
45d1aeecc3
commit
522d23e2c5
1 changed files with 19 additions and 14 deletions
|
@ -98,20 +98,25 @@ export async function extractAllPackageFiles(
|
||||||
}
|
}
|
||||||
|
|
||||||
elevateFileReplacePositionField(extractedDeps).forEach((dep) => {
|
elevateFileReplacePositionField(extractedDeps).forEach((dep) => {
|
||||||
const key = dep.managerData.packageFile;
|
const key = dep.managerData?.packageFile;
|
||||||
const pkgFile: PackageFile = packageFilesByName[key];
|
// istanbul ignore else
|
||||||
const { deps } = pkgFile;
|
if (key) {
|
||||||
deps.push({
|
const pkgFile: PackageFile = packageFilesByName[key];
|
||||||
...dep,
|
const { deps } = pkgFile;
|
||||||
registryUrls: [
|
deps.push({
|
||||||
...new Set([
|
...dep,
|
||||||
...defaultRegistryUrls,
|
registryUrls: [
|
||||||
...(dep.registryUrls || []),
|
...new Set([
|
||||||
...registryUrls,
|
...defaultRegistryUrls,
|
||||||
]),
|
...(dep.registryUrls || []),
|
||||||
],
|
...registryUrls,
|
||||||
});
|
]),
|
||||||
packageFilesByName[key] = pkgFile;
|
],
|
||||||
|
});
|
||||||
|
packageFilesByName[key] = pkgFile;
|
||||||
|
} else {
|
||||||
|
logger.warn({ dep }, `Failed to process Gradle dependency`);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return Object.values(packageFilesByName);
|
return Object.values(packageFilesByName);
|
||||||
|
|
Loading…
Reference in a new issue