Skip to content

Commit 940f18f

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

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
@@ -2049,7 +2049,12 @@ open class KotlinFileExtractor(
20492049
tw.writeCallableEnclosingExpr(id, callable)
20502050

20512051
if (c.typeArgumentsCount == 1) {
2052-
extractTypeAccessRecursive(c.getTypeArgument(0)!!, locId, id, -1, callable, enclosingStmt, TypeContext.GENERIC_ARGUMENT)
2052+
val typeArgument = c.getTypeArgument(0)
2053+
if (typeArgument == null) {
2054+
logger.errorElement("Type argument missing in an arrayOfNulls call", c)
2055+
} else {
2056+
extractTypeAccessRecursive(typeArgument, locId, id, -1, callable, enclosingStmt, TypeContext.GENERIC_ARGUMENT)
2057+
}
20532058
} else {
20542059
logger.errorElement("Expected to find exactly one type argument in an arrayOfNulls call", c)
20552060
}

0 commit comments

Comments
 (0)