diff --git a/apina-core/src/main/kotlin/fi/evident/apina/java/reader/ClassMetadataReader.kt b/apina-core/src/main/kotlin/fi/evident/apina/java/reader/ClassMetadataReader.kt index 756ddd3..60f3d49 100644 --- a/apina-core/src/main/kotlin/fi/evident/apina/java/reader/ClassMetadataReader.kt +++ b/apina-core/src/main/kotlin/fi/evident/apina/java/reader/ClassMetadataReader.kt @@ -176,9 +176,9 @@ internal object ClassMetadataReader { } override fun visitParameter(name: String?, access: Int) { - val nextParameter = method.parameters[parameterIndex++] + val nextParameter = method.parameters.getOrNull(parameterIndex++) - if (name != null) + if (name != null && nextParameter != null) nextParameter.name = name }