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

Commit 3a7b28f

Browse files
committed
invoke結果がnullの場合マッパーを呼ぶと落ちる問題を修正
1 parent 38f62d7 commit 3a7b28f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/kotlin/com/mapk/kmapper/BoundParameterForMap.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ internal sealed class BoundParameterForMap<S> {
4646
override val propertyGetter: Method,
4747
private val boundKMapper: BoundKMapper<T, *>
4848
) : BoundParameterForMap<S>() {
49-
override fun map(src: S): Any? = boundKMapper.map(propertyGetter.invoke(src) as T)
49+
override fun map(src: S): Any? = (propertyGetter.invoke(src))?.let { boundKMapper.map(it as T) }
5050
}
5151

5252
internal class ToEnum<S : Any>(

0 commit comments

Comments
 (0)