Skip to content

Commit

Permalink
[K/N] Skip missing dependencies during cache building
Browse files Browse the repository at this point in the history
This fix is somewhat similar to the one for KT-70146, see explanation there
why it's safe to just skip those dependencies.

 #KT-73858 Fixed
  • Loading branch information
homuroll authored and Space Team committed Jan 16, 2025
1 parent 8b57d44 commit b968b02
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ internal fun KotlinLibrary.getAllTransitiveDependencies(allLibraries: Map<String

fun traverseDependencies(library: KotlinLibrary) {
library.unresolvedDependencies.forEach {
val dependency = allLibraries[it.path]!!
val dependency = allLibraries[it.path] ?: return@forEach
if (dependency !in allDependencies) {
allDependencies += dependency
traverseDependencies(dependency)
Expand Down Expand Up @@ -102,8 +102,8 @@ class CacheBuilder(
} else {
if (cache == null) externalLibrariesToCache += library
}
library.unresolvedDependencies.forEach {
val dependency = uniqueNameToLibrary[it.path]!!
library.unresolvedDependencies.forEach dependenciesLoop@{
val dependency = uniqueNameToLibrary[it.path] ?: return@dependenciesLoop
dependableLibraries.getOrPut(dependency) { mutableListOf() }.add(library)
}
}
Expand Down

0 comments on commit b968b02

Please sign in to comment.