Skip to content

Commit b968b02

Browse files
homurollSpace Team
authored and
Space Team
committed
[K/N] Skip missing dependencies during cache building
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
1 parent 8b57d44 commit b968b02

File tree

1 file changed

+3
-3
lines changed
  • kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan

1 file changed

+3
-3
lines changed

kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/CacheBuilder.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ internal fun KotlinLibrary.getAllTransitiveDependencies(allLibraries: Map<String
2828

2929
fun traverseDependencies(library: KotlinLibrary) {
3030
library.unresolvedDependencies.forEach {
31-
val dependency = allLibraries[it.path]!!
31+
val dependency = allLibraries[it.path] ?: return@forEach
3232
if (dependency !in allDependencies) {
3333
allDependencies += dependency
3434
traverseDependencies(dependency)
@@ -102,8 +102,8 @@ class CacheBuilder(
102102
} else {
103103
if (cache == null) externalLibrariesToCache += library
104104
}
105-
library.unresolvedDependencies.forEach {
106-
val dependency = uniqueNameToLibrary[it.path]!!
105+
library.unresolvedDependencies.forEach dependenciesLoop@{
106+
val dependency = uniqueNameToLibrary[it.path] ?: return@dependenciesLoop
107107
dependableLibraries.getOrPut(dependency) { mutableListOf() }.add(library)
108108
}
109109
}

0 commit comments

Comments
 (0)