diff --git a/shared/src/commonMain/kotlin/com/lightningkite/serialization/DataClassPathSerializer.kt b/shared/src/commonMain/kotlin/com/lightningkite/serialization/DataClassPathSerializer.kt index c6bfed5d..37397bc5 100644 --- a/shared/src/commonMain/kotlin/com/lightningkite/serialization/DataClassPathSerializer.kt +++ b/shared/src/commonMain/kotlin/com/lightningkite/serialization/DataClassPathSerializer.kt @@ -77,7 +77,7 @@ class DataClassPathSerializer(val inner: KSerializer): KSerializerWithDefa if(part.endsWith('?') || prop.serializer.descriptor.isNullable && index != valueParts.lastIndex) { @Suppress("UNCHECKED_CAST") current = DataClassPathNotNull(current as DataClassPath) - currentSerializer = currentSerializer.nullElement()!! + currentSerializer = currentSerializer.nullElement() ?: throw SerializationException("${prop.name} is not nullable") } }