Fix compile error in DateFactory

This commit is contained in:
Vladimir Shefer 2020-09-28 13:32:08 +03:00
parent c942c39307
commit 399c9f0abc
1 changed files with 2 additions and 2 deletions

View File

@ -5,8 +5,8 @@ import java.lang.reflect.Type
class DateFactory : JsonAdapter.Factory {
override fun create(type: Type, annotations: Set<out Annotation>, moshi: Moshi): JsonAdapter<*>? {
val typeName = when(type) {
is Class<*> -> type.canonicalName
val typeName: String = when(type) {
is Class<*> -> type.canonicalName ?: type.toString()
else -> type.toString()
}