Skip to content

Commit a1fc05d

Browse files
committed
Fixed retrieval of non existing values
1 parent fe55fd9 commit a1fc05d

File tree

1 file changed

+1
-1
lines changed
  • kotlin-insight-client/kotlin-insight-client-api/src/main/kotlin/com/linkedplanet/kotlininsightclient/api/model

1 file changed

+1
-1
lines changed

kotlin-insight-client/kotlin-insight-client-api/src/main/kotlin/com/linkedplanet/kotlininsightclient/api/model/Model.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ fun InsightObject.addValue(id: Int, name: String? = null, value: Any?) {
116116
fun <T> InsightObject.getValue(id: Int, transform: (Any) -> T): T? =
117117
getAttribute(id)
118118
?.value
119-
?.single()
119+
?.firstOrNull()
120120
?.value
121121
?.let { transform(it) }
122122

0 commit comments

Comments
 (0)