Skip to content

Commit 5840377

Browse files
authored
Merge pull request #10113 from igfoo/igfoo/nullexpr
Kotlin: Remove another instance of a not-null-expression
2 parents c904ba1 + 5d670c6 commit 5840377

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
@@ -4150,7 +4150,12 @@ open class KotlinFileExtractor(
41504150
startIndex: Int = 0,
41514151
reverse: Boolean = false
41524152
) {
4153-
extractTypeArguments((0 until c.typeArgumentsCount).map { c.getTypeArgument(it)!! }, tw.getLocation(c), parentExpr, enclosingCallable, enclosingStmt, startIndex, reverse)
4153+
val typeArguments = (0 until c.typeArgumentsCount).map { c.getTypeArgument(it) }.requireNoNullsOrNull()
4154+
if (typeArguments == null) {
4155+
logger.errorElement("Found a null type argument for a member access expression", c)
4156+
} else {
4157+
extractTypeArguments(typeArguments, tw.getLocation(c), parentExpr, enclosingCallable, enclosingStmt, startIndex, reverse)
4158+
}
41544159
}
41554160

41564161
private fun extractArrayCreationWithInitializer(

0 commit comments

Comments
 (0)