Skip to content

Commit

Permalink
Better DataClassPathSerializer errors
Browse files Browse the repository at this point in the history
  • Loading branch information
bjsvedin committed Nov 4, 2024
1 parent 763a15c commit 0c2f1d2
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class DataClassPathSerializer<T>(val inner: KSerializer<T>): KSerializerWithDefa
if(part.endsWith('?') || prop.serializer.descriptor.isNullable && index != valueParts.lastIndex) {
@Suppress("UNCHECKED_CAST")
current = DataClassPathNotNull(current as DataClassPath<T, Any?>)
currentSerializer = currentSerializer.nullElement()!!
currentSerializer = currentSerializer.nullElement() ?: throw SerializationException("${prop.name} is not nullable")
}
}

Expand Down

0 comments on commit 0c2f1d2

Please sign in to comment.