mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-12 15:06:27 +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) => {
|
||||
const key = dep.managerData.packageFile;
|
||||
const pkgFile: PackageFile = packageFilesByName[key];
|
||||
const { deps } = pkgFile;
|
||||
deps.push({
|
||||
...dep,
|
||||
registryUrls: [
|
||||
...new Set([
|
||||
...defaultRegistryUrls,
|
||||
...(dep.registryUrls || []),
|
||||
...registryUrls,
|
||||
]),
|
||||
],
|
||||
});
|
||||
packageFilesByName[key] = pkgFile;
|
||||
const key = dep.managerData?.packageFile;
|
||||
// istanbul ignore else
|
||||
if (key) {
|
||||
const pkgFile: PackageFile = packageFilesByName[key];
|
||||
const { deps } = pkgFile;
|
||||
deps.push({
|
||||
...dep,
|
||||
registryUrls: [
|
||||
...new Set([
|
||||
...defaultRegistryUrls,
|
||||
...(dep.registryUrls || []),
|
||||
...registryUrls,
|
||||
]),
|
||||
],
|
||||
});
|
||||
packageFilesByName[key] = pkgFile;
|
||||
} else {
|
||||
logger.warn({ dep }, `Failed to process Gradle dependency`);
|
||||
}
|
||||
});
|
||||
|
||||
return Object.values(packageFilesByName);
|
||||
|
|
Loading…
Reference in a new issue