Merge pull request #94 from TouchInstinct/feature/bugfix

Fix compile error in DateFactory
This commit is contained in:
Vladimir Shefer 2020-09-28 14:07:40 +03:00 committed by GitHub
commit d34a8734f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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()
}