Skip to content
This repository was archived by the owner on Jan 20, 2023. It is now read-only.

Commit 6fd8b03

Browse files
committed
パラメータが空リストだった時に落ちる問題を修正
1 parent 17f71fe commit 6fd8b03

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/kotlin/com/mapk/fastkfunction/FastKFunction.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ sealed class FastKFunction<T> {
132132
companion object {
133133
@TestOnly
134134
internal fun List<KParameter>.checkParameters() = also {
135-
val requireInstanceParameter = this[0].kind != KParameter.Kind.VALUE
135+
val requireInstanceParameter = !isEmpty() && this[0].kind != KParameter.Kind.VALUE
136136

137137
if (isEmpty() || (requireInstanceParameter && size == 1))
138138
throw IllegalArgumentException("This function is not require arguments.")

0 commit comments

Comments
 (0)