Skip to content

Commit 44501f5

Browse files
committed
Kotlin: Remove another not-null-expr
1 parent da7b7ce commit 44501f5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

java/kotlin-extractor/src/main/kotlin/KotlinFileExtractor.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1776,10 +1776,15 @@ open class KotlinFileExtractor(
17761776
fun extractMethodAccess(syntacticCallTarget: IrFunction, extractMethodTypeArguments: Boolean = true, extractClassTypeArguments: Boolean = false) {
17771777
val typeArgs =
17781778
if (extractMethodTypeArguments)
1779-
(0 until c.typeArgumentsCount).map { c.getTypeArgument(it)!! }
1779+
(0 until c.typeArgumentsCount).map { c.getTypeArgument(it) }.requireNoNullsOrNull()
17801780
else
17811781
listOf()
17821782

1783+
if (typeArgs == null) {
1784+
logger.warn("Missing type argument in extractMethodAccess")
1785+
return
1786+
}
1787+
17831788
extractRawMethodAccess(syntacticCallTarget, c, callable, parent, idx, enclosingStmt, (0 until c.valueArgumentsCount).map { c.getValueArgument(it) }, c.dispatchReceiver, c.extensionReceiver, typeArgs, extractClassTypeArguments, c.superQualifierSymbol)
17841789
}
17851790

0 commit comments

Comments
 (0)