diff --git a/plugins/package-managers/node/src/main/kotlin/yarn2/Yarn2.kt b/plugins/package-managers/node/src/main/kotlin/yarn2/Yarn2.kt index f3e6b90a30475..0da767d8be1e3 100644 --- a/plugins/package-managers/node/src/main/kotlin/yarn2/Yarn2.kt +++ b/plugins/package-managers/node/src/main/kotlin/yarn2/Yarn2.kt @@ -322,7 +322,7 @@ class Yarn2( .forEach { (dependencyType, allScopedDependencies) -> allProjects.values.forEach { project -> val dependencies = allScopedDependencies[project.id] - val dependenciesInfo = dependencies?.mapNotNull { dependency -> + val dependenciesInfo = dependencies?.mapNotNullTo(mutableSetOf()) { dependency -> if ("Yarn2" in dependency.type) { val projectAsDependency = allProjects.entries.find { entry -> entry.key.type == "Yarn2" && entry.key.name == dependency.name && @@ -360,7 +360,7 @@ class Yarn2( ) } } - }?.toSet().orEmpty() + }.orEmpty() graphBuilder.addDependencies(project.id, dependencyType.type, dependenciesInfo) }