File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
frameworks/Kotlin/ktor/ktor-r2dbc/src/main/kotlin/org/jetbrains/ktor/benchmarks Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -157,13 +157,14 @@ private fun getWorld(
157157 .execute())
158158 .flatMap { r ->
159159 Mono .from(r.map { row, _ ->
160- val id = row.get(0 , Int ::class .java)
161- val randomNumber = row.get(1 , Int ::class .java)
162- if (id != null && randomNumber != null ) {
163- World (id, randomNumber)
164- } else {
160+ val id = row.get(" id" , Int ::class .java) ? : row.get(0 , Int ::class .java)
161+ val randomNumber = row.get(" randomnumber" , Int ::class .java) ? : row.get(1 , Int ::class .java)
162+
163+ if (id == null || randomNumber == null ) {
165164 throw IllegalStateException (" Database returned null values for required fields" )
166165 }
166+
167+ World (id, randomNumber)
167168 })
168169 }
169170}, Connection ::close)
You can’t perform that action at this time.
0 commit comments