Skip to content

Commit 01f27ea

Browse files
committed
Kotlin: Remove another not-null-expr
1 parent 940f18f commit 01f27ea

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
@@ -2117,7 +2117,12 @@ open class KotlinFileExtractor(
21172117

21182118
if (isBuiltinCallKotlin(c, "arrayOf")) {
21192119
if (c.typeArgumentsCount == 1) {
2120-
extractTypeAccessRecursive(c.getTypeArgument(0)!!, locId, id, -1, callable, enclosingStmt, TypeContext.GENERIC_ARGUMENT)
2120+
val typeArgument = c.getTypeArgument(0)
2121+
if (typeArgument == null) {
2122+
logger.errorElement("Type argument missing in an arrayOf call", c)
2123+
} else {
2124+
extractTypeAccessRecursive(typeArgument, locId, id, -1, callable, enclosingStmt, TypeContext.GENERIC_ARGUMENT)
2125+
}
21212126
} else {
21222127
logger.errorElement("Expected to find one type argument in arrayOf call", c )
21232128
}

0 commit comments

Comments
 (0)