From d776ca574c019413a886823e53e6e18c64f7259a Mon Sep 17 00:00:00 2001 From: naftalmm Date: Sat, 19 Feb 2022 12:44:09 +0300 Subject: [PATCH] fallback to default implementation of `IColumnType.readObject` method only if `columnType` is unknown (not if its actual implementation of this method returned `null`) (#1452) --- .../src/main/kotlin/org/jetbrains/exposed/sql/ResultRow.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/ResultRow.kt b/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/ResultRow.kt index 18ec52928f..7f212594b7 100644 --- a/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/ResultRow.kt +++ b/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/ResultRow.kt @@ -88,7 +88,8 @@ class ResultRow( fun create(rs: ResultSet, fieldsIndex: Map, Int>): ResultRow { return ResultRow(fieldsIndex).apply { fieldsIndex.forEach { (field, index) -> - val value = (field as? Column<*>)?.columnType?.readObject(rs, index + 1) ?: rs.getObject(index + 1) + val columnType = (field as? Column<*>)?.columnType + val value = if (columnType != null) columnType.readObject(rs, index + 1) else rs.getObject(index + 1) data[index] = value } }